filtering a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form which I would like to filter. I have a checkbox that I want to
use to filter the form by. If the checkbox is checked, I want the record to
appear - otherwise not.
I apparently don't understand this feature.
TIA

Papa
 
It's not very clear what yo are asking for.

Is it to filter the form or make the records apear if the check box is
checked?

The records are on the form or SubForm

A code you can start with on the AfterUpdate event of the check box (if that
what you are looking for).

Assign a record source to the form, assuming you mean for a sub form

If Me.CheckBoxName = True Then
Me.[SubFormControlName].Form.RecordSource = "Select * From TableName"
Else
Me.[SubFormControlName].Form.RecordSource = ""
End If
Me.[SubFormControlName].Requery
 
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.CheckBoxName = 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
 
Ofer
I am not sure I understand your direction. I guess I do not understand the
filter aspect. You are correct that what I hope for is to only have records
show up in the form if the particular checkbox is checked. This is not in a
subform. Does that clarify?

Papa

Ofer Cohen said:
It's not very clear what yo are asking for.

Is it to filter the form or make the records apear if the check box is
checked?

The records are on the form or SubForm

A code you can start with on the AfterUpdate event of the check box (if that
what you are looking for).

Assign a record source to the form, assuming you mean for a sub form

If Me.CheckBoxName = True Then
Me.[SubFormControlName].Form.RecordSource = "Select * From TableName"
Else
Me.[SubFormControlName].Form.RecordSource = ""
End If
Me.[SubFormControlName].Requery


--
Good Luck
BS"D


Papa Jonah said:
I have a form which I would like to filter. I have a checkbox that I want to
use to filter the form by. If the checkbox is checked, I want the record to
appear - otherwise not.
I apparently don't understand this feature.
TIA

Papa
 
I have no idea what this means. Can you clarify this for me? What does this
mean "assign a record source"
"that doesn't return any records"?


Ofer Cohen said:
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.CheckBoxName = 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



--
Good Luck
BS"D


Papa Jonah said:
I have a form which I would like to filter. I have a checkbox that I want to
use to filter the form by. If the checkbox is checked, I want the record to
appear - otherwise not.
I apparently don't understand this feature.
TIA

Papa
 

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

Back
Top