still trying to filter a form

G

Guest

I am trying to set up a form so that, as I scroll through records, only the
records that have a certain checkbox checked appear. I think the terminology
for this is "filter" - but based on previous posts - maybe not.

The checkbox is not part of any subform - just on the main form.

The following was suggested to me - but I have no idea what it means. For
example, where would I insert this code? Why would it be better to have this
record source that DOES NOT return any records? If I didn't want any records
- I wouldn't being doing anything. If it doesn't return any records - how
can the record source not be empty?
Do you see my confustion?

Please help!

It will be better to assign a record source wth filter that doesnt return
any
records, and not empty record source that might display #names# in the text
boxes.
Something like

If Me.Check78 = True Then
Me.[SubFormControlName].Form.RecordSource = "Select * From TableName"
Else
Me.[SubFormControlName].Form.RecordSource = "Select * From TableName
Where KeyFieldName = Null"
End If
Me.[SubFormControlName].Requery
 
J

John W. Vinson

I am trying to set up a form so that, as I scroll through records, only the
records that have a certain checkbox checked appear. I think the terminology
for this is "filter" - but based on previous posts - maybe not.

You can certainly do this with either a filter, or by basing the Form on a
query with a criterion of True on the yes/no field. You can set a Filter by
clicking the "funnel" icon on the form toolbar.
The checkbox is not part of any subform - just on the main form.

A Checkbox is a TOOL - it's not a value. I presume that the checkbox is bound
to a Yes/No field in the main form's Table? Don't forget - Forms don't contain
data; Tables do!


John W. Vinson [MVP]
 

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

Top