Hello, I tried to figure this out. I really need this database to work! I have the main form called FRM_All Visitors, the subform in the main form is called frm_VRINfoSub. I created a separate form named FRM_Active Personnel based on a query that identifies all the active personnel (Name & Authorization Info) that are currently active for access in different areas and some personnel may have at least 4 authorizations under their name. So I created a button on the separate form (FRM_Active Personnel) that when pressed will open the main form (FRM_All Visitors) and have the subform (Frm_VRInfoSub) either find or goto the identified record which is named the VR_Visitor_ID. I have the VR_Visitor_ID in the subform (frm_VRINfoSub) and the separate form (FRM_Active Personnel). I am unable to link both forms with the VR_Visitor_ID. At this time, the form will open the main form and the first record in the subform based on the Primary_Visitor ID. My goal in creating the separate form (FRM_Active Personnel) was to enable to user to go directly to the active identified record in the subform to check all the other information before badging the visitors instead of them scrolling through the records. I know it is my coding because I am not identifying the separate form. I came across the coding the for ProcError because I kept getting the 2105 Error. Thank you for your assistance.
Private Sub cmdGO_TO_RECORD_Click()
On Error GoTo ProcError
Dim sWhere As String
sWhere = "Primary_Visitor_ID=" & Me!Primary_Visitor_ID
DoCmd.OpenForm "FRM_All Visitors", , , sWhere
Forms![FRM_All Visitors]![frm_VRInfoSub].SetFocus
sWhere = "VR_Record_ID=" & Me!VR_Record_ID
DoCmd.GoToRecord , , acNext
ExitProc:
Exit Sub
ProcError:
Select Case Err.Number
Case 2105
MsgBox "Only 1 record in this list.", _
vbInformation, "End of the list..."
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, , _
"Error in NextPP_Click procedure..."
End Select
Resume ExitProc
End Sub