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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top