RonnieODIN
Registered User.
- Local time
- Today, 20:40
- Joined
- Jun 15, 2012
- Messages
- 46
Hi
I am trying to make a query that sorts my records by three cascading cbo's in my main form. At the moment the sub form containing the query is not updated before the third box is filled out.
What I would like is the following:
• When the cbo's are blank all records must be shown.
• The records are filtered as the cbo's are filled out and not just when all are filled out.
My VBA is as follows:
The SQL for one of the cbo's (the other two are equivalent) in the query is as follows:
Hope that someone will able to help me.
I am trying to make a query that sorts my records by three cascading cbo's in my main form. At the moment the sub form containing the query is not updated before the third box is filled out.
What I would like is the following:
• When the cbo's are blank all records must be shown.
• The records are filtered as the cbo's are filled out and not just when all are filled out.
My VBA is as follows:
Option Compare Database
Private Sub cboCurrentCity_AfterUpdate()
Me!subMaskiner.Requery
Me!Tekst15 = [Forms]![frmListeMaskiner]![cboCurrentCity]
End Sub
Private Sub cboCurrentCostumer_AfterUpdate()
Me!cboCurrentCountry = ""
Me!cboCurrentCity = ""
Me!cboCurrentCountry.Requery
Me!subMaskiner.Requery
Me!Tekst15 = [Forms]![frmListeMaskiner]![cboCurrentCostumer]
End Sub
Private Sub cboCurrentCountry_AfterUpdate()
Me!cboCurrentCity = ""
Me!cboCurrentCity.Requery
Me!subMaskiner.Requery
Me!Tekst15 = [Forms]![frmListeMaskiner]![cboCurrentCountry]
End Sub
The SQL for one of the cbo's (the other two are equivalent) in the query is as follows:
IIf([Formularer]![frmListeMaskiner]![cboCurrentCostumer]="";"";[Formularer]![frmListeMaskiner]![cboCurrentCostumer])
Hope that someone will able to help me.