L
LarryE
I have a table field that the user can input text into using a Form.
I want to use: Name oldfilename As NewFileName
action to change the name of a file based on what they input.
I am having a terrible time getting the Name action to read (lookup) the
table field name.
I am getting runtime error 53 'File Not Found'
Here is my code:
Dim OldFileName, NewFileName As String
OldFileName = "C:\ORCAS Backup\BackupORCAS.accdb"
NewFileName = "C:\ORCAS Backup\" & DLookup("[BackupFileName]", "Company Name
Table", "[BackupFileName]=Forms![Backup Data Form]![BackupFileName]") &
".accdb"
Name OldFileName As NewFileName
So if the user inputs 'Johns Backup', the OldFileName should be changed to
Johns Backup.accdb
The table field information is in: Tables![Company Name
Table]![BackupFileName]
I also tried referencing the table field name instead of DLookup(), but I
get the same error.
Can anyone help me with the syntax to reference the table field in the Name
action?
Thank you.
I want to use: Name oldfilename As NewFileName
action to change the name of a file based on what they input.
I am having a terrible time getting the Name action to read (lookup) the
table field name.
I am getting runtime error 53 'File Not Found'
Here is my code:
Dim OldFileName, NewFileName As String
OldFileName = "C:\ORCAS Backup\BackupORCAS.accdb"
NewFileName = "C:\ORCAS Backup\" & DLookup("[BackupFileName]", "Company Name
Table", "[BackupFileName]=Forms![Backup Data Form]![BackupFileName]") &
".accdb"
Name OldFileName As NewFileName
So if the user inputs 'Johns Backup', the OldFileName should be changed to
Johns Backup.accdb
The table field information is in: Tables![Company Name
Table]![BackupFileName]
I also tried referencing the table field name instead of DLookup(), but I
get the same error.
Can anyone help me with the syntax to reference the table field in the Name
action?
Thank you.