MS Access - How to open attachment window in form by button - sql

How can I create a button in form to open attachment window by clicking on it using macros or vba?

Saving objects in database tables uses up Access 2GB size limit. Attachment field is a multi-value type and can be frustrating to manage. Most experienced developers leave files in external folder location. Review Add/view attachments using MS Access VBA and Access Attachment Dialog Window.
However, following code worked for me.
Me.attachmentcontrolname.SetFocus
DoCmd.RunCommand acCmdManageAttachments

Related

Saving Access file to SharePoint with code

I have a standard Access Database saved on SharePoint. My organization uses SharePoint, but I only have standard access to areas particular to my department. (I cannot create or link a web based database to SharePoint with my access level.)
In my Access file, I have a form that saves its data to the table - locally - when I hit the submit button.
The ribbon below appears and if clicked, transfers the whole Access file to the SharePoint storage location, but only if that button is clicked. Otherwise it only saves a local copy.
Is there a way I can automate a network/SharePoint save location in code so the user doesn't have to remember to press that button?
After a week of trying to figure this out - there's a simpler solution.
Save the file as an exectuable - accde instead of accdb. Not only does it not ask to run the macros every time, but it saves automatically to SharePoint.
Hope this helps someone else in the future.

Exporting a picture or snapshot of a form to Powerpoint from Access 2010

I want to be able to create a loop in Access VBA that basically opens up my form based on a parameter, takes a picture or copies the form somehow and then pastes that image into a Powerpoint deck. The loop would then close the form, get the next parameter to open the same form with new data and do the same operation on the next slide of the Powerpoint deck.
I've googled this and cannot find anything that works for me. Thanks!
REVISION:
Since this seems to be a challenge to accomplish directly within Access, let me ask it another way. I've tried to output the form to a PDF file through VBA
DoCmd.OutputTo acOutputForm, "MYFORM", acFormatPDF, "MYPATH & MYFILENAME"
When I do this in a loop I only get the very last form that opens, as if when Access is sending each form to the PDF file it is overwriting the last one each time. The other problem is that I need to output the form in landscape and I'm not sure how get this to happen in the PDF file. Are there any settings that go with this method or code that would precede or follow it that would allow me to accomplish this? This is alternative because I can then just manually convert the PDF to Powerpoint if I need to.

how to open the vba form in external application like notepad and notead++

I want to know how to read the ms access form (vba form) via external application
like (notepad,notepad++).
In vb6 application can be able to read the [control name],[code] in the external application (notepad,notepad++).
but, there is no option for to do the same operation in the ms access forms.
when i open the form in the database i can ,but not in the notepad and notepad++.
It is possible or not (or) is there any other way to do this action.
You can only access the form code that is shown in the VBA editor. In VB and C# you can view the code that actually creates the control objects and initialises them (I think it is this that you are referring to). You can't see this code in Access / VBA.
If you want to edit the code in Notepad++ simply copy and paste it from the VBA code editor (which is shown when you press ALT+F11).
PS. I use a access addin called OASIS-SVN that can export all object definitions as text files, I probably does it as described here
If you want to edit VBA projects files outside from VBE, you first need to Export them (using Right-click->Export a file) and save them somewhere.
Then you'll be able to open them with notepad(++).
Don't forget to Import them back into your VBA Project after editing.

Excel macro runs Access macro issue

I have an Excel macro that imports files into an Access database. The Excel macro uses a shell command to open Access and kick off a macro in the Access database. The Access macro runs an Access VBA function that runs several routines in Access. This works for me. I'm located in the US.
A UK user tries to run the Excel macro. Access opens but displays an error message. The Access database is located on the UK server.
I remoted in to the user's machine and opened the Access database. I then selected "macros" and pushed the "run macro" icon. A pop-up displayed and showed the macro name. You had to click "Ok" or "cancel". I've never seen this before and was wondering if this is the reason that the UK user gets the error message.
Any suggestions would be appreciated. thanks...........
Try going into the settings of his Access. If all fails, download and use this program called Express ClickYes. It automatically clicks yes when message boxes in Access pops up

Using Word automation, is it possible to find out if the active document contains VBA code?

Using Word Automation, I want to save the active document programmatically. In Office 2007/2010, the document needs to be saved explicitly as "macro enabled" to preserve any VBA code in that document.
Rather than asking the user to choose, I would like my application to be able to determine if there is VBA code in the active document. Is that possible?
Yes this can be determined via the HasVBProject property. For example:
If ActiveDocument.HasVBProject = True Then
'Code to save as .dotm
Else
'Code to save as .dotx
End If
For those who might stumble upon this post later, it is worth noting that this code should be placed outside the document being tested for the presence of macros (otherwise it would detect itself). Two often-used options would be to access the code from an external application or from a template stored in Word's Startup folder.