Use checkbox in form to apply filter in query

sebekkg

New member
Local time
Today, 00:55
Joined
Apr 22, 2017
Messages
4
Hello guys, I am new in working in access, and need your help.

I made some form for searching database. I want to use checkbox that will apply some filter to additionally apply in query. It should be something like this

IF chk_box is checked
then market='NON-EU'
else everything to be displayed.


Market is text field and has two values 'EU' and 'NON-EU'.
 
Put the code in the AfterUpdate event of the chkBox...

Code:
Sub chkBox_afterupdate()
IF chkbox.value then
   Me.filter="[market]='NON-EU'"
   Me.filterOn= true
else   'everything to be displayed.
  Me.FilterOn= false
End if
End sub
 

Users who are viewing this thread

Back
Top Bottom