michaeljohannes
Registered User.
- Local time
- Today, 05:38
- Joined
- May 3, 2007
- Messages
- 67
Hi VB coders,
I have a bit of code that opens an Excel template file from an Access form:
This code works well (as expected).
I'm wondering if there is a way to populate certain fields in this excel spreadsheet based on fields from the form I just left?
For example, I would like the new excel file to have the JobNumber and LastName from the access form I just left, populated in the appropriate fields in the excel document.
I'm a little new to VB code so I apologize if this looks weird, but is it something like:
I have a feeling this isn't that hard, but I'm a bit stuck. I would appreciate any help you might be able to offer
Thank you!
Mike
I have a bit of code that opens an Excel template file from an Access form:
Code:
Private Sub OpenExcelFile_Click()
Dim objXLApp As Object
Dim objXLBook As Object
Set objXLApp = CreateObject("Excel.Application")
Set objXLBook = objXLApp.Workbooks.Open("C:\ExcelFile.xltm")
objXLApp.Application.Visible = True
End Sub
This code works well (as expected).
I'm wondering if there is a way to populate certain fields in this excel spreadsheet based on fields from the form I just left?
For example, I would like the new excel file to have the JobNumber and LastName from the access form I just left, populated in the appropriate fields in the excel document.
I'm a little new to VB code so I apologize if this looks weird, but is it something like:
Code:
me.LastName (from Access form) = me.c23 (in Excel spreadsheet)
I have a feeling this isn't that hard, but I'm a bit stuck. I would appreciate any help you might be able to offer

Thank you!
Mike