filter ?

A

Arvin Meyer [MVP]

Use VBA code to change the form's recordsource in the combo's after update
event, or base the form's recordsource on a query that reads the combo's
value and requery it in the combo box's after update event.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
I

IanOxon via AccessMonster.com

Alternatively, you can filter the form based on your combo box, cmbName,
selection.

Private Sub cmbName_AfterUpdate()
On Error GoTo Err_cmbName_AfterUpdate

If IsNull(cmbName.Value) Then
Me.Filter = ""
Me.FilterOn = False
Else
Me.Filter = "[strName]='" & cmbName.Value & "'"
Me.FilterOn = True
End If

Exit_cmbName_AfterUpdate:
Exit Sub

Err_cmbName_AfterUpdate:
MsgBox "cmbName_AfterUpdate Error: " & Err.Number & ": " & Err.
Description
Resume Exit_cmbName_AfterUpdate
End Sub
 
Top