Problem with "blank" query

B

Bob Richardson

This Frame has 4 radio buttons. When the user clicks the first button
(option value=0) I want to display all records in the file. This works for
the other cases but not for Case 0. What's my problem?

Select Case Frame31.Value
Case 0 ' All Contacts
Qry = ""
Case 1 ' Presenters
Qry = "[PresenterYN] = Yes"
Case 2 ' Beach Watcher
Qry = "[BeachWatcher] = Yes"
Case 3 ' NewsLetter
Qry = "[NewsLetter] = Yes"
End Select
Me.Filter = Qry
Me.FilterOn = True
 
A

Allen Browne

Try turning the form's FilterOn property off to show all records:

Select Case Frame31.Value
Case 0 ' All Contacts
Me.FilterOn = False
Case 1 ' Presenters
Me.Filter = "[PresenterYN] = Yes"
Me.FilterOn = True
Case 2 ' Beach Watcher
...
 
B

Bob Richardson

Perfect. Thanks Allen.

Allen Browne said:
Try turning the form's FilterOn property off to show all records:

Select Case Frame31.Value
Case 0 ' All Contacts
Me.FilterOn = False
Case 1 ' Presenters
Me.Filter = "[PresenterYN] = Yes"
Me.FilterOn = True
Case 2 ' Beach Watcher
...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Bob Richardson said:
This Frame has 4 radio buttons. When the user clicks the first button
(option value=0) I want to display all records in the file. This works
for the other cases but not for Case 0. What's my problem?

Select Case Frame31.Value
Case 0 ' All Contacts
Qry = ""
Case 1 ' Presenters
Qry = "[PresenterYN] = Yes"
Case 2 ' Beach Watcher
Qry = "[BeachWatcher] = Yes"
Case 3 ' NewsLetter
Qry = "[NewsLetter] = Yes"
End Select
Me.Filter = Qry
Me.FilterOn = True
 

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

Similar Threads


Top