I have a large, old application to handle biological recording which I've just moved from an old XP machine to Windows 7.
The path on the new machine is different to the path on the old machine.
The application is split into data and application parts, so the application contains a variable (strPath) which points to the data file. I've changed this to agree with the new installation and the Switchboard code runs correctly and opens the data file.
The Switchboard has a button to open a form to add a new record (button code is below) which, when clicked, gives the 'Invalid path' error on the DoCmd line in bold
Private Sub cmdNewRecord_Click()
'On Error GoTo Err_cmdNewRecord_Click
Dim stDocName As String
stDocName = "NewRecord"
DoCmd.OpenForm stDocName
Exit_cmdNewRecord_Click:
Exit Sub
Err_cmdNewRecord_Click:
MsgBox Err.Description
Resume Exit_cmdNewRecord_Click
End Sub
The application file opens the Access objects and linked tables, and runs the start up code and displays the Switchboard OK, so I don't see why I'm getting this error. The form NewRecord is, of course, in the same app.mdb file as the switchboard.
I'm stuck with what appears to be a simple error, any suggestions gratefully received.
ColinH
The path on the new machine is different to the path on the old machine.
The application is split into data and application parts, so the application contains a variable (strPath) which points to the data file. I've changed this to agree with the new installation and the Switchboard code runs correctly and opens the data file.
The Switchboard has a button to open a form to add a new record (button code is below) which, when clicked, gives the 'Invalid path' error on the DoCmd line in bold
Private Sub cmdNewRecord_Click()
'On Error GoTo Err_cmdNewRecord_Click
Dim stDocName As String
stDocName = "NewRecord"
DoCmd.OpenForm stDocName
Exit_cmdNewRecord_Click:
Exit Sub
Err_cmdNewRecord_Click:
MsgBox Err.Description
Resume Exit_cmdNewRecord_Click
End Sub
The application file opens the Access objects and linked tables, and runs the start up code and displays the Switchboard OK, so I don't see why I'm getting this error. The form NewRecord is, of course, in the same app.mdb file as the switchboard.
I'm stuck with what appears to be a simple error, any suggestions gratefully received.
ColinH