Keith
Registered User.
- Local time
- Today, 02:25
- Joined
- May 21, 2000
- Messages
- 129
For some hours now I have been researching how to pass a parameter to a query in VBA. I can't get my head around it - I must be thick.
I have a function that when called transfers a query recordset to an excel spreadsheet then emails it. At the end of the function I use code to write the date sent to a table. Each time the function is called I only need records in the query that have been modified since the last time the function was called. I have a field in the query 'LastModified' with a criteria '>[Enter Date]'. I then look up the date in the table and enter it manually. I know how to look up the last date sent in table using code but getting the >#SomeDate# in the query with VBA is causing my white hair to get even whiter.
I have a function that when called transfers a query recordset to an excel spreadsheet then emails it. At the end of the function I use code to write the date sent to a table. Each time the function is called I only need records in the query that have been modified since the last time the function was called. I have a field in the query 'LastModified' with a criteria '>[Enter Date]'. I then look up the date in the table and enter it manually. I know how to look up the last date sent in table using code but getting the >#SomeDate# in the query with VBA is causing my white hair to get even whiter.
Code:
DoCmd.TransferSpreadsheet acExport, , "qryUpdateWebmaster", _
"C:\Submariners\Updates_Sent\" & fname & ".xlsx", True, "Webmaster_Update"
Last edited: