I have this in a module called import:
Public Function Import_Data_Enter()
Dim strFileName As String ' you could make this global if need be
dlgCommon.ShowOpen
strFileName = dlgCommon.FileName
If strFileName = "" Then End
DoCmd.TransferText acImportDelim, "import", "Activity_File", strFileName
End Function
I then created a macro that would run the module but it fails out everytime at the dlgCommon.ShowOpen line.
The error says:
object required...
The code works fine if i put a button on a form and just run the code from the button, but i need it to be a macro for other reasons.
Thanks,
Shane
Public Function Import_Data_Enter()
Dim strFileName As String ' you could make this global if need be
dlgCommon.ShowOpen
strFileName = dlgCommon.FileName
If strFileName = "" Then End
DoCmd.TransferText acImportDelim, "import", "Activity_File", strFileName
End Function
I then created a macro that would run the module but it fails out everytime at the dlgCommon.ShowOpen line.
The error says:
object required...
The code works fine if i put a button on a form and just run the code from the button, but i need it to be a macro for other reasons.
Thanks,
Shane