I have a main form with a tab control (TabCtl) containing several tabs. Tab1 contains a subform (employee) used to enter the employee’s data. Tab2 contains a subform (jobs) used to enter the jobs completed by the employee. Each subform in a tab contains the field employee ID. I would like to use a combo box (cboFindRecord) located on the main form to search the selected tab for the employee id selected.
In the past I”ve use the following to find a record on the main form but I can’t seem to get it to work on the tab control
Private Sub cboFindRecord_AfterUpdate()
' Find the record that matches the control.
On Error GoTo ProcError
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[EmpID] = '" & Me![cboFindRecord] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
ExitProc:
Exit Sub
ProcError:
MsgBox "Error: " & Err.Number & ". " & Err.Description
Resume ExitProc
End Sub
Thanks in advance
In the past I”ve use the following to find a record on the main form but I can’t seem to get it to work on the tab control
Private Sub cboFindRecord_AfterUpdate()
' Find the record that matches the control.
On Error GoTo ProcError
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[EmpID] = '" & Me![cboFindRecord] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
ExitProc:
Exit Sub
ProcError:
MsgBox "Error: " & Err.Number & ". " & Err.Description
Resume ExitProc
End Sub
Thanks in advance