Modules & VBA :: FileDialog 429 Error On Opening Selected Document
Oct 10, 2013
The following code is throwing a 429 error when opening the selected document (code in red). How do I correct this?
Code:
Dim f As Object
Dim FileName As String
Set fd = Application.FileDialog(1)
Dim FileChosen As Integer
FileChosen = fd.Show
[Code] ....
View Replies
ADVERTISEMENT
Jan 26, 2015
From Here I want it to open the ".csv" that I chose (for some reason it doesn't now), Import to a table (I can do this part). Then export to the same location on the server with a different file name of my choosing and covert to .xlsx.
Dim fdlg As FileDialog: Set fdlg = Application.FileDialog(msoFileDialogFilePicker)
Do
With fdlg
.AllowMultiSelect = False
.Title = "Select File to Import"
.Filters.Clear
.Filters.Add "All Files", "*.*", 1
[Code] ....
View 3 Replies
View Related
Sep 14, 2006
I've used the Outputto method to archive reports creted in Access to Word in .rtf.
I now want to have an option to view these archives from Access. How?
Thanks,
Richard
View 2 Replies
View Related
Feb 4, 2005
I have a form with various details on clients. I have 6 different letters that need to pull off different fields from the client form. Is it possible to have a button (for each letter) that when when clicked will open up the word document for the specific client with the fields on their poulated, such as name, ammount owed etc.
Mail merge does not do the trick as it brings back all the clients in the database and not the specific one.
View 7 Replies
View Related
Nov 29, 2014
When i run the following code to open my report a receive the following error..
error 3070 the microsoft access database engine does not recognise " as a valid field name or expression
Code:
strDocName = "rptBarcodingMonthly"
MsgBox strDocName
DoCmd.OpenReport strDocName, acViewPreview
The code behind the report - sets on open_report event is the following however i cant see any issues with it as i use it elsewhere..
Code:
' Create underlying recordset for report using criteria entered in
Dim intX As Integer
Dim qdf As QueryDef
Dim frm As Form
' Set database variable to current database.
Set dbsReport = CurrentDb
[code]....
I will also attach a copy of how i set the criteria in the query and the parameters
View 1 Replies
View Related
Jan 12, 2005
I have completed a form that I am ready to put into production. I want to include a couple help documents with the database. There are two word documents that are stored as OLE objects in a table. I normally wouldn't include OLE objects like this because I would want to keep the DB size down, but there should only be 2-3 small word documents
What needs to happen:
click a button on a form and have the correct word document open.
The tbl they are stored in is called tblAddins. Two columns thus far, named:
ID (autonumber primary key)
file (OLE)
The only thing that the wizard (wish i didn't need to use it) gives me for Word is to open the application itself.
Thanks in advance to the great minds of this forum for any help.
View 3 Replies
View Related
Feb 15, 2005
How is it possible to open a form letter word docment from an Access form in which information on the form (such as name and address) is used in the letter?
View 3 Replies
View Related
Aug 5, 2015
I would like to open a Word document using a button control on a form to a file path listed in a field on the form. I use the following code when I want to open a single specific document...
Dim wdApp As Word.Application, wdDoc As Word.Document
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wdDoc = wdApp.Documents.Open(File path here)
wdApp.Visible = True
...but in this case the file path I want to use will be designated by a field on the form. I know I could just use a hyperlink but I don't like the way it looks on the form. I would rather hide that field and have code pull that path when I hit the button.
So how would I change my code to make it so the value in the file path field on the form goes in where it says "File path here" in my code above?
View 2 Replies
View Related
Jun 11, 2013
Here's my Goal: To open a saved query that has a parameter, setting that parameter via a VBA sub.
Here's my Problem: I was getting various errors, but after debugging my program a bit, it comes down to a "Data Type Conversion Error"
Here's my Code:
Set db = CurrentDb
Set qd = db.QueryDefs("qryMY_DATA")
qd.Parameters(0) = Me.txt_ReferenceID
Set rs = qd.OpenRecordset("qryMY_DATA", dbDynaset)
Code:
'*** Database Variables
Dim db As DAO.Database, rs As DAO.Recordset, gq As DAO.QueryDef, prm As DAO.Recordset
I've been all over the forums and tried several different approaches, all to no avail. The Query runs fine in the QDT, but kicks back an error when I try to run it from my sub.
View 10 Replies
View Related
Feb 12, 2006
Dear All
I have a form with memo field as [acLetter]. Now whenever I open the form the text in the memo forms are all selected/highlighted in all the records. Is there any settings required to disable this feature or have I missed out something, so that the text should not be selected at the time of opening the form.
Thanks
View 1 Replies
View Related
Oct 16, 2012
I do some error analysis for debugging an Access DB. My question is are there some regulations or frameworks, which could support my work.
View 2 Replies
View Related
Jun 23, 2015
I have created a Db in MS Access 2010 and under Options > Current Database I have done the following:
- Used drop down to select a form I want to display on opening
- Unchecked display navigation pane
- Unchecked allow full menus
This works how I want it to, perfectly. I then send it to a client who also has MS Access 2010 and when they open the file the form I have told it to open doesn't open, the navigation bar is displayed (with the form I want to open highlighted) and the full menus show but are locked.
What's going on? Is it some security setting the client has that isn't letting the opening procedure execute properly?
View 1 Replies
View Related
Jul 13, 2006
Hi,
I was wondering if anyone might be able to help me with this. I was trying to get a filedialog popup windows to show up so that user can enter a filename for saving purpose.
The following is the code i got from Access help but didn't work.
Private Sub CM_openfiledialog_Click()
Dim dlgSaveAs As FileDialog
Set dlgSaveAs = Application.FileDialog( _
FileDialogType:=msoFileDialogSaveAs)
dlgSaveAs.Show
End Sub
I got a compiler error saying "user-defined type not defined". it seems not being able to identify the Filedialog.
Any ideas?
Thank you in advance
View 2 Replies
View Related
Jan 31, 2006
I'm attaching the code for a function that's attached to a button that allows the users to export data from a form to the directory and file of their choice.
This code works when we're just running Access, but we need it to function in runtime, and it just crashes with an entirely uninformative "runtime error" message.
I didn't write this code, but looking at it, it seems to be just a copy of what's in the MS knowledge base about the filedialog function.
I also never write my own applications using runtime (the program we're running this is was contracted for our lab), so I have no idea why this would be failing in runtime but not in Access. Can anyone help?
View 1 Replies
View Related
Sep 23, 2013
Is it possible to format a PDF document created in MS Access i.e. set the document to landscape instead of portrait as in the following code;
DoCmd.OutputTo acOutputQuery, "Query Name", acFormatPDF, "Document Name", False
This PDF document is attached to an MS Outlook e-mail and sent without any intervention from the user. This is accomplished using further VBA code. This code is working at the moment sending both Excel spread sheets and PDF documents but the PDF's require the page formatting before sending. I want to be able to accomplish this without having to open another application such as Adobe Acrobat.
View 3 Replies
View Related
Dec 26, 2014
I use the following code to achieve following
a) Open a word document from MS access / VBA,
b) Connect to data from a query
c) mailmerge it
d) Save it as a new document containing mailemerged letters.
The code does open the required document as I can see it open.
I put a message box to recheck that filename/path is what I mean, and to to know till which line the code runs. Code runs till that point and that word doc is seen open. I get the error message before
Then I get error message.
I was fooling around and was getting message " This command is not available because no document is open" I tried to remove few lines thinking redundancy. Before getting the message, I was also getting the error trapping message "No documents opened."
Now I am getting different message.
I am getting message " The remote Server Machine does not Exist or is unavailable"
Following is the code I have written.
Dim xlApp As Object
Set xlApp = CreateObject("word.Application")
xlApp.Visible = True
fn = FormPathName("941 2014 AutoOpen.doc")
[Code] .....
View 5 Replies
View Related
Jul 18, 2015
We need to replicate an Access report we have in Microsoft Word. The report has a fixed, small image in the header and so we embedded it in the report (it is not in an external file). To put this image in the Word document the only way we have come up with is shown in the code below.
Code:
Dim apWord As Word.Application
Dim doc As Word.Document
Set apWord = CreateObject("Word.application")
doc.Shapes.AddPicture "G:ImagesSinful Banner.bmp", False, True, 0, 0, 540, 42
Which requires an external image file. We really would like to avoid this. We could make a template Word document, but that too would be an external file. We know how to put this image in a table as an OLE object, but can't find any way to get it from the table into the Word document.
View 12 Replies
View Related
Jan 19, 2014
When I execute the below function I get an error. If I use the commented out "Open" line it works fine. I get Run-time error '52'. Bad file name or number.
Private Sub GenerateSSA_Click()
Dim strRA As Variant, strFileNew As String, strFileBlank As String
Dim intFileOut As Integer
Dim rstWork As DAO.Recordset
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
[Code] ....
View 7 Replies
View Related
Jul 2, 2015
I have built a simple database (by no means complete) but I am after adding some further code into it. Basically on the form [FrmMain] I have a button that allows me to send a document to a relevant CSU contact. It finds the file name based on the info in the table TblResident. What I want to do is open the word document before sending and add a password to it using vba.
View 1 Replies
View Related
Feb 5, 2015
I have been trying to populate a merge document from access. I have the dotx files organised and the recipient file (Query) within my main access project. The following code opens word, opens the selected file (dotx) but can't find the db file.
I am using access 2010 and .accdb database format. I have temporarily put in MsgBox lines to display the running content of fields and they are producing the right info.
Private Sub DocumentsCbo_Click()
' load precedent template as a dotx, merge fields into precedent document, allow user to modify if needed, save it as a pdf
On Error GoTo ErrTrap
Dim MyPath As String ' Path of the source template
Dim DestPath As String ' Path of destination document
[Code] ....
View 1 Replies
View Related
Aug 21, 2014
Not sure if this is possible but I am trying to extract data from a word document to set up a database.
Basically I am trying to capture data from completed forms, similar to the sample attached, the actual blank form is 20 pages long and once completed can be as many as 30 pages, or even more, although the format doesnt change (i.e. individidual cells will expand to fit the data in the cell).
I want to be able to scan through the completed forms and extract the data i.e. Full Study Title, Short Study Title, Study Type etc. into a database.
The issues:
1. Each document will have a different name but will be stored in the same location.
2. What is on page 8, for example, in one document is not necessarity going to be the same on every document (due to expanding cells)
3. Each sector is in a separate table but tables can spread across several pages.
4. Some data is stored in a checkbox format rather than text.
5. I dont want to extract all of the data, only certain sections (at least at this stage).
View 1 Replies
View Related
Mar 18, 2015
If I use the word template named "ABC.dot" as attached and write the following piece of code to print off the letters with different appropriate background , it works perfectly fine:
Code:
Sub PrintLetters()
Application.DisplayAlerts = False
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim r As Long
Set cn = New ADODB.Connection
[Code] ....
But if I combine two templates together in one template as attached "Capita.dot" then it doesn't display background picture at all in any of the cases. I am using the same piece of code but the background image is not displaying. The background image shows logos for each letter like For capita letters , the logo will be capita . For Friends Life letters the logo background will be different.
View 1 Replies
View Related
Aug 14, 2015
List box named: lstEvents
and 2 forms
Main 1: frmEvents
2nd 1: frmEventsEdit1
I have the codeing from here URL....Now, the problem im having is, that for the shows I have this code:
Code:
ShowNames: ([ShowName] & " " & Format([StartDate],"mm-yyyy"))
That is so that each show has the month and year attached to the name, so its easier to find out when they were, from just looking at them in the list box.But, if I use the search that John (The OP of that link) then if I were to search for 2015, and try to open a show, it just opens to a blank frmEventsEdit1. Even though I currently just tell it:
Code:
DoCmd.OpenForm "frmEventsEdit1", , , "EventID = " & Me.lstShows
I would like two things.Either, to figure out why that isn't working, or 2, to get this If sentence im working on that goes like this:
Code:
If "EventID" = " " Then MsgBox "Error, please try again" Else DoCmd.OpenForm "frmEventsEdit1", , , "EventID = " & Me.lstShows
View 13 Replies
View Related
Dec 17, 2013
I'm using ACCESS 2010. I have a form which is having a embedded word document. What I'm trying to do is i want to enable user to format a mail in the embedded word document which will contain rich text and screenshots then with a click of button an outlook mail should open and content of this document should be pasted there. Once user sends this email, I want to save content of embedded document in the database.
View 4 Replies
View Related
Oct 12, 2014
I have hp scanner whose twain driver has the option to scanning in the pdf document.
Microsoft WIA 2.0 have save scanned document only to graphical format.
I want automated (on click any button control) to scan multipage document from glass source or ADF to pdf document and attach it to attachment field.
I'm found VB Module for accessing TWAIN compatible scanner but it is call twain software and scan to bmp format with assigned name of file.
Me need it also only use the pdf format .
View 7 Replies
View Related
Jul 16, 2014
The code below allows me to open a publisher document that is already merged to the current record. What I need is to allow the user to open the document according to the group they are reviewing. How to accomplish this?
For example:
IF Group = A1 OR B1 THEN OPEN AB_1.pub
IF Group = A2 OR B2 THEN OPEN AB_2.pub
IF Group = A3 OR B3 THEN OPEN AB_3.pub
Dim pubApp As Publisher.Application
Dim pubDoc As Publisher.Document
Set pubApp = New Publisher.Application
Set pubDoc = pubApp.Documents.Add.Application.Open("c:Publishe rAB_1.pub)
pubDoc.ActiveWindow.Visible = True
View 3 Replies
View Related