Filter Form based on Value of control on another form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form called Plant with a combobox control which is used to select an
employeeID. On double clicking this control, I would like to open that
employees details form. Opening the required form on the double click is
easy. How do I filter this form (or jump to the correct record), based on the
value in the Plant form?

Thanks

Dave
 
The form can be filtered like this:

Private Sub combobox _DblClick(Cancel As Integer)
On Error GoTo Err_combobox _DblClick

DoCmd.OpenForm "employees details", , , "[employeeID]=" & Me![employeeID]

Exit_combobox _DblClick:
Exit Sub

Err_combobox _DblClick:
MsgBox "combobox _DblClick Error: " & Err.Number & ": " & Err.Description
Resume Exit_txtFinish_BeforeUpdate
End Sub
 
Thanks, works perfectly.

IanOxon via AccessMonster.com said:
The form can be filtered like this:

Private Sub combobox _DblClick(Cancel As Integer)
On Error GoTo Err_combobox _DblClick

DoCmd.OpenForm "employees details", , , "[employeeID]=" & Me![employeeID]

Exit_combobox _DblClick:
Exit Sub

Err_combobox _DblClick:
MsgBox "combobox _DblClick Error: " & Err.Number & ": " & Err.Description
Resume Exit_txtFinish_BeforeUpdate
End Sub

I have a form called Plant with a combobox control which is used to select an
employeeID. On double clicking this control, I would like to open that
employees details form. Opening the required form on the double click is
easy. How do I filter this form (or jump to the correct record), based on the
value in the Plant form?

Thanks

Dave
 
Back
Top