I am converting an application from Access 2000 to 2007. Most things are converting fine, with a few tweaks. I’m pleasantly surprised. However, this piece of code gives me an error. I am feeding the code some variables, then asking it to see if a file exists in the location fed by the variables. The code errors on the With line and the message is:
Error 2455: You entered an expression that has an invalid reference to the property FileSearch.
With Application.FileSearch ‘looks to see if the temp.mdb already exists
If TransferDrive = “A” Then
MsgBox “Insert blank diskette in your drive now.”, vbOKOnly, “Instert diskette”
.LookIn = “A:”
.filename = “Temp.mdb”
If .Execute = 0 Then ‘file doesn’t exist
GoTo Continue
Else
MsgBox “The temp file already exists. Insert another diskette.”, vbOKOnly, “Insert New Diskette”
GoTo ExitHere
End If
Else
And so on ….
Any ideas as to what I’m missing? I have a reference to the Microsoft Access 12.0 Object Library.
Thanks for any suggestions.
Nancy