D
dr
Hi All,
Have a good day.
I want to have records filter on my opened form.
I created an unbound combo box and set its rowSource
from a textfield of query builder of the form.
I created 3 combo box.
2 combobox data type is text while the other is number.
I want when the combo box updated,my form shows
filtered record.But it seems my code doesn't work.
What could be wrong from bellow code:
Private Sub cbo_SelectModel_AfterUpdate()
Dim strFilter As String
Me.cbo_SelectLotNo.Value = ""
Me.cbo_SelectPRSNo.Value = ""
DoCmd.Requery "cbo_SelectLotNo"
DoCmd.Requery "cbo_SelectPRSNo"
If Not IsNull(Me.cbo_SelectModel) Then
stWhere = """Outgoing_qry.ModelID = " & _
Me.cbo_SelectModel.Value & """"
Me.Form.Filter = strWhere
Me.FilterOn = True
End If
End Sub
Have a good day.
I want to have records filter on my opened form.
I created an unbound combo box and set its rowSource
from a textfield of query builder of the form.
I created 3 combo box.
2 combobox data type is text while the other is number.
I want when the combo box updated,my form shows
filtered record.But it seems my code doesn't work.
What could be wrong from bellow code:
Private Sub cbo_SelectModel_AfterUpdate()
Dim strFilter As String
Me.cbo_SelectLotNo.Value = ""
Me.cbo_SelectPRSNo.Value = ""
DoCmd.Requery "cbo_SelectLotNo"
DoCmd.Requery "cbo_SelectPRSNo"
If Not IsNull(Me.cbo_SelectModel) Then
stWhere = """Outgoing_qry.ModelID = " & _
Me.cbo_SelectModel.Value & """"
Me.Form.Filter = strWhere
Me.FilterOn = True
End If
End Sub