I have a small issue I think should be fairly easy to resolve, but I'm a beginner so I'm stuck.
I need to pull spreadsheets from Excel into an Access 2010 database I'm building. Here's the code I'm using right now.
Code:
Function import_hl7()
On Error GoTo import_hl7_Err
DoCmd.TransferSpreadsheet acImport, 8, "master_table", "C:\Documents and Settings\redacted\Desktop\test\redacted.xls", True, ""
import_hl7_Exit:
Exit Function
import_hl7_Err:
MsgBox Error$
Resume import_hl7_Exit
End Function
This works just fine. The problem is that each day the spreadsheet will have a different name, so ideally I would like to be able to import the Excel document I currently have open. That way I can just open 'todays' document and run the script to import it without worrying about paths and file names.
Thank you,