I have an Access 97 database that I use to log visits to customers. On the click of a "log visit" button, the database is suppose to take the autonumber(ProjectID) of the record I am on and pass that to the log table when opening the log form "Visit Logs". It is failing to do so and below is the commands I have used. Please advise if there is an easier way to do this that is consistent. Thanks!
Private Sub Command68_Click()
On Error GoTo Err_Command68_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Visit Logs"
stLinkCriteria = "[ProjectID]=" & Me![ProjectID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command68_Click:
Exit Sub
Err_Command68_Click:
MsgBox Err.Description
Resume Exit_Command68_Click
End Sub