Command Button To View PDF / Excel File Or JPEG From Object Within Database Table
Aug 12, 2013
I have created a database for a church cemetery. It contains the usual names, birthrates deaths, etc.... I have also created a map of the cemetery in PDF format with the lot number highlighted which is assigned to a particular record. I did the same in excel with a layout of the lot and a JPEG picture of the grave marker. In my table I created Three columns - Site Plan, Lot Plan, and Grave marker. I insert the specific site plan, lot plan, and jpeg picture using the "insert object" in the table. On my form after a search, I have created three buttons.. Site Plan, Lot Plan & Grave Marker.
I have looked and experimented trying to assign these command buttons to open these files on the form. I don't have any experience with macros or VB code.
View Replies
ADVERTISEMENT
Nov 3, 2006
I am trying to open a workbook with a command button on a form however the path to the file is giving me a fit. The path for the file location contains spaces and I am going blind trying to figure out how to rectify the path. Heres the line. I am sure someone here will see this problem quick! Thanks.
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim stAppName As String
stAppName = "Excel.exe N:OPSCOMMONOpsResearchContact CenterDI CCL Reporting dBApps by Agent.xls"
Call Shell(stAppName, 1)
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
Heres the mess I made out of it:
stAppName = "Excel.exe N:OPSCOMMONOpsResearchContact" & Chr(32) & "CenterDI" & Chr(32) & "CCL" & Chr(32) & "Reporting" & Chr(32) & "dBApps" & Chr(32) & "by" & Chr(32) & "Agent.xls"""
:confused:
View 6 Replies
View Related
Nov 15, 2006
Is this possible? A command button when click will open an excel file... :rolleyes:
Cheers!
Sheila
View 5 Replies
View Related
Dec 22, 2006
Hi All,
I have three excel files (ActualHires.xls, ActualPromotions.xls and
ActualSeparation.xls). These are password protected files (with the
same password). They are linked to an access database and whenever the
files are opened, one must supply the password and click the 'Enable
automatic refresh button.' What I was wondering was if this could be
done in access with a command button. I have pasted some code below
that I found but now I'm getting an error.
This is the code:
Dim BookNames As Variant
Dim B As Long
BookNames = Array("O:ExcelFilesActualHires.xls",
"O:ExcelFilesActualPromotions.xls",
"O:ExcelFilesActualSeparations.xls")
For B = LBound(BookNames) To UBound(BookNames)
WorkBooks.Open FileName:=BookNames(B), _
UpdateLinks:=3, Password:="*******"
WorkBooks(B).Close SaveChanges:=False
Next B
But when I click the button, I get this error:
Run-time error '9' Subscript out of range.
and this line is highlighted:
WorkBooks(B).Close SaveChanges:=False
Any help would be greatly appreciated.
Thanks.
View 1 Replies
View Related
May 18, 2006
I'm looking for someone to help me with a solution to my problem of importing data into a data table.
What I'd like to do is have a command button on a form. When this button is clicked the records in a table are cleared out. Then I'd like for a browse window to come up to locate an Excel file. The user would select this file and the data would be imported into the data table that was just cleared.
Can this be done without too much trouble?
Thanks, Paul
View 4 Replies
View Related
Aug 28, 2014
Is it possible to have a command button on a form to run the Text File Import Into a Table Wizard?
View 13 Replies
View Related
Jan 17, 2014
I have a form with three text boxes and one command button
I want to hide the command button from view until at least one of the boxes has data in it. I also want the command button to return to hidden if the data is removed
So far I have tried this on the after update event on one zof the text boxeswith absolutely no success.
Code:
If Me.txtFirstName = "" And Me.txtLastName = "" And Me.txtSocialInsuranceNumber = "" Then
Me.cmdAddNewClient.Visible = False
Else
Me.cmdAddNewClient.Visible = True
End If
View 11 Replies
View Related
Dec 20, 2005
I have set up a command button within a form and wish to output results from a query for a specific company. The query has been set up.
View 1 Replies
View Related
Jul 27, 2015
How do I equally space buttons on my forms using the property sheet in design view? I have been using the ruler, but it can be a pain sometimes.
View 3 Replies
View Related
Jul 13, 2012
I need to figure out how to display my excel file name in my cbProjectList
I place all my excel sheets in my drive D:
with the following file names
09th of July Project List.xlsx
10th of July Project List.xlsx
11th of July Project List.xlsx
12th of July Project List.xlsx
can this be possible....
View 1 Replies
View Related
Jun 17, 2005
I have a button on a form, to open Excel, I need to open the relevant file at the same time...
Dim oApp As Object
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
My file is located...C:ship info imeline.xls
any ideas please...
View 2 Replies
View Related
Jul 12, 2013
I am trying to open MX Excel using a command button. I have tried using a hyperlink a various codes that i have found online with no luck. The Excel file is being used by the Access as it bring data from the spreadsheet a displays it within a subform. (I think this is where the problem occurs) The subform displaying some data from Excel is working fine but when i click my hyperlinked button i am met with errors and the file will not open.
View 6 Replies
View Related
Jan 15, 2014
I am trying to open MX Excel using a command button. I have tried using a hyperlink and various codes that i have found online with no luck. The Excel file is being used by Access as it bring data from the spreadsheet and displays it within a subform. (I think this is where the problem occurs) The subform displaying some data from Excel is working fine but when i click my hyperlinked button (To open the excel file) i am met with errors and the file will not open.
View 1 Replies
View Related
Nov 28, 2012
What would the VBA command line look like to export a report to Excel using a command button ?
View 3 Replies
View Related
Jun 13, 2006
I have set up a database that houses file locations. The form that I have made shows a job # and the files that correlate with it. I would like to set up a command button that will read the file name and open it in Excell. If any one know how to do this I would greatly appreciate the help.
View 3 Replies
View Related
Aug 19, 2015
I would like to open a PDF document using a button control on a form to a file path listed in a field on the form (Me.Link). I am trying to use the followHyperlink code but I keep getting the runtime 490 error.
This is the code im using:
Dim strFilePath As String
strFilePath = Me.Link
Application.FollowHyperlink (strFilePath)
If I put a filepath to one of the pdf documents in the place of (strFilePath) it opens that pdf document fine but not when I declare a filepath based on the one listed on the form.
View 8 Replies
View Related
Mar 4, 2014
I have managed to export the data that I want into a spreadsheet using a command button.
Once my colleagues have completed the spreadsheet, I need a command button on a form with a file search dialogue box which will allow them to transfer the spreadsheet back into the database - updating the relevant records rather that over writing them.
Is there a VB code/Macro I can use which will allow me to do this?
View 2 Replies
View Related
Oct 19, 2014
I have created an accdb file and saved as an accde file. The accde file opens with a form with command buttons. But the commands buttons do not work with the accde file (they do work with the accdb file). How do I get them working.
View 7 Replies
View Related
Oct 10, 2006
I want to use command buttons to open two separate .csv files in the same excel workbook on different tabs. Is this possible?
View 4 Replies
View Related
Mar 27, 2014
I'm trying to design a command button on a Form so the user can import the contents of an Excel spreadsheet to an existing Table in Access with the click of a button. But, i'd like the imported data to overwrite the existing data in the Table and not append to it. I've considered using linked tables but apparently you can't set Primary Keys when you do it this way.
View 4 Replies
View Related
Apr 22, 2014
In Access, it is possible to create a query from a command button and export to excel?
View 1 Replies
View Related
Apr 18, 2013
I need to open a specific pdf file per record by using a command button. The pdf files will all reside in a specific folder in a partition on my hard drive. Each pdf file will have a unique four digit file name e.g 1234.pdf.The file name will match a unique number allocated to each record. This number is generated by adding 1000 to the record ID.Record 10 will therefore have an associated pdf file name of 1010.pdf.I have created a text box field , named 'TestReportID', to capture the unique four digit number per record that I assume is needed to be referred to when setting up the code to find and display the correct related pdf file.
I have set up a command button on the records form and as simple test using the hyperlink address to the folder where the pdf files reside, I can open a pdf file by clicking on the command button but it does not matter what record is open when I click the command button, it will always open the same pdf file.If I don't identify a specific file name in the hyperlink address, when I click on the button it will display a file open dialog which lists all the relevant pdf files and I can then select and open the required file.I would like to cut out that step and get the correct file to open when I click the button.
View 2 Replies
View Related
Jan 11, 2015
I would like to create a form that allows me to search for a folder on my desk top, then once located i can transfer that file to a specific location on another drive, Similar to the Browse / upload function you see on many applications.I am using Access 2003. Is this possible??
View 5 Replies
View Related
Oct 7, 2014
I am looking for a function that will allow me to encrypt/decrypt single image files as and when required. I have built my own simple one to encrypt a string that will be stored in a filename as all the ones I found created unusable filenames.
However I don't know where to start with the image file encryption.
(Any better way to encrypt a string that can be used in a file name that would be great too. My method is a bit basic).
View 2 Replies
View Related
May 16, 2014
Why the ability to view the properties of an object within a form is not available when you double click on it in design view?
I was happily working away double clicking on a command button to edit some code when for some reason the next time I tried to edit it did not open up for me.
I was unable to access it even by right clicking on the object & selecting properties as that also appears to be disabled, not greyed out or anything but just does nothing when selected.
Have I inadvertently changed a setting somewhere that prevents the properties from being displayed?
View 3 Replies
View Related
Aug 18, 2015
I'm working with Access 2010 and am trying to use the transferspreadsheet command to output data in a query to an Excel 2010 format file. Here is the line of code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "q_calldetails_tmp", "c: emp estoutput.xlsx"
It works fine and produces the output file but when I try and open it with Excel I get an error saying the format is incorrect. If I change the extension to .xls it opens with no problem but I need it to be an Excel 2010 format with correct extension.
View 3 Replies
View Related