CheckBox on form

  • Thread starter Thread starter PawelR
  • Start date Start date
P

PawelR

Hello group,
I beginner in Access.
I have in database table with [boolean] colum - ColChose . I show this table
on form. On form I have to checkBox.
I want do this that if checkBox is checked show only record with ColChose is
true. If checkBox is unchecked show all rows.

thx. PawelR
 
Add another check box to your form, and give it these properties:
Default Value No
Name chkFilterColChose
After Update [Event Procedure]
You must leave the Control Source blank.

Click the Build button (...) beside the After Update property.
Access opens a code window.
Between the "Private Sub..." and "End Sub lines paste:

If Me.Dirty Then 'Save before filter.
Me.Dirty = False
End If
If Me.chkFilterColChose.Value Then
Me.Filter = "ColChose = True"
Me.FilterOn = True
Else
Me.FilterOn = False
End If
 

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