Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009

    Unanswered: Using Button to Get focus on Specific Records

    Hi There,

    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

    Exit Sub

    MsgBox Err.Description
    Resume Exit_Enter_Test_Data_Click
    End Sub

    Thanks in advance for any help.

  2. #2
    Join Date
    May 2005
    Nevada, USA
    Provided Answers: 6
    It sounds like your value is text, which requires a slightly different syntax:

    Open a second form to the record

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts