Unanswered: Using Button to Get focus on Specific Records
I have a DB to track work order production and now I have created a new table and form to collect test data. I have inserted a button in to the line entry form called "enter test data." When the operator clicks this button, I would like access to open the "enter test report information" form and get focus on the corresponding serial number. Both of the forms have the identical fields "panel serial number". So for example, if they are working on serial number 1234567 and they click the button, it should open the "enter test report information" form on record 1234567.
I have some code running on a double click operation elsewhere in the DB, but when I tried to modify it for this application it gives me this error message: "data type mismatch in criteria expression."
Is there some thing wrong with this code?
Private Sub Enter_Test_Data_Click()
On Error GoTo Err_Enter_Test_Data_Click:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Enter Test Report Information"
stLinkCriteria = "[Panel Serial Number]=" & Me![Panel Serial Number]
DoCmd.OpenForm stDocName, , , stLinkCriteria