G
Guest
Hello:
On my form I have:
A List Box named lstLocations.
Row Source for List Box lstLocations is this query:
SELECT Incidents.JobLocRm, Incidents.JobLocCampus, Incidents.Selected
FROM Incidents
GROUP BY Incidents.JobLocRm, Incidents.JobLocCampus, Incidents.Selected
HAVING (((Incidents.JobLocRm)=[forms]![frmReportsLocations]![OptionLetter]));
In the footer of my form I placed an option group called CommonNameFilters
and I also created a text box named OptionLetter (for the selected criteria):
it has option buttons for user to click, eg.
A B C ...
If user clicks on A - lstLocation should fill with rooms starting with A,
when he/she click on B then it should fill with room starting with B, etc.
I have on click event on the lstlocation which places a proper string in the
OptionLetter text box.
On click event:
Private Sub CommonNameFilters_Click()
Select Case CommonNameFilters
Case 1
Me.OptionLetter = "like ""A*""" 'this is my text box to hold
the criteria
Me.lstLocations.Requery
Case 2
Me.OptionLetter = "B"
Me.lstLocations.Requery
End Select
End Sub
However, the query does not work and it does not select rooms with the
selected letter criteria in the option group.
It must be more effective way. I am not getting a box filled with the
values for the criteria selected by user in the option group.
Can you assist?
On my form I have:
A List Box named lstLocations.
Row Source for List Box lstLocations is this query:
SELECT Incidents.JobLocRm, Incidents.JobLocCampus, Incidents.Selected
FROM Incidents
GROUP BY Incidents.JobLocRm, Incidents.JobLocCampus, Incidents.Selected
HAVING (((Incidents.JobLocRm)=[forms]![frmReportsLocations]![OptionLetter]));
In the footer of my form I placed an option group called CommonNameFilters
and I also created a text box named OptionLetter (for the selected criteria):
it has option buttons for user to click, eg.
A B C ...
If user clicks on A - lstLocation should fill with rooms starting with A,
when he/she click on B then it should fill with room starting with B, etc.
I have on click event on the lstlocation which places a proper string in the
OptionLetter text box.
On click event:
Private Sub CommonNameFilters_Click()
Select Case CommonNameFilters
Case 1
Me.OptionLetter = "like ""A*""" 'this is my text box to hold
the criteria
Me.lstLocations.Requery
Case 2
Me.OptionLetter = "B"
Me.lstLocations.Requery
End Select
End Sub
However, the query does not work and it does not select rooms with the
selected letter criteria in the option group.
It must be more effective way. I am not getting a box filled with the
values for the criteria selected by user in the option group.
Can you assist?