I have created a button that I want to fine a specific record based on its serial number. After the record is found I want a query to be executed based on the serial number that would record what time the button was pushed.
What is currently happening is when I click on the button. I get a message that I am going to run the query. But I never get to enter the serial number so the time stamp gets recorded on the first record.
Here is my code:
Private Sub btnFindRecord_Click()
On Error GoTo Err_btnFindRecord_Click
Dim stDocName As String
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
'Start counting Time
'Dim stDocName As String
stDocName = "qryFunctionalTestTI"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_btnFindRecord_Click:
Exit Sub
Err_btnFindRecord_Click:
MsgBox Err.Description
Resume Exit_btnFindRecord_Click
End Sub
What is currently happening is when I click on the button. I get a message that I am going to run the query. But I never get to enter the serial number so the time stamp gets recorded on the first record.
Here is my code:
Private Sub btnFindRecord_Click()
On Error GoTo Err_btnFindRecord_Click
Dim stDocName As String
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
'Start counting Time
'Dim stDocName As String
stDocName = "qryFunctionalTestTI"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_btnFindRecord_Click:
Exit Sub
Err_btnFindRecord_Click:
MsgBox Err.Description
Resume Exit_btnFindRecord_Click
End Sub