473,386 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Filtering Table field in Form using Check Boxes

1
Good day everyone.
I am working with Ms Access. What I want to happen is to filter the Month field using the check boxes. When I check the Check boxez the Month field didn't filter the specific check box once I checked. Here's the picture and codes:
Expand|Select|Wrap|Line Numbers
  1. If (Me.chkJan = 0) Then
  2.     If Not (Trim(strCriteria) = vbNullString) Then
  3.         strCriteria = strCriteria & " AND "
  4.     End If
  5.     strCriteria = strCriteria & "NOT [Month_Name] = 'January'"
  6. End If
Thanks
Jul 7 '16 #1
1 751
NeoPa
32,556 Expert Mod 16PB
Try the following structure :
Expand|Select|Wrap|Line Numbers
  1. Private Function SetCriteria() AS String
  2.     With Me
  3.         If .chkJan Then _
  4.             setCriteria = setCriteria & " AND ([Month_Name]='January')"
  5.         If .chkFeb Then _
  6.             setCriteria = setCriteria & " AND ([Month_Name]='February')"
  7.         If .chkMar Then _
  8.             setCriteria = setCriteria & " AND ([Month_Name]='March')"
  9.         ...
  10.         If .chkDec Then _
  11.             setCriteria = setCriteria & " AND ([Month_Name]='December')"
  12.     End With
  13.     SetCriteria = Mid(setCriteria, 6)
  14. End Function
Jul 8 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mohammed Mazid | last post by:
Can anyone please help me on this. I want to use radio buttons and check boxes for this application but how do I store the solutions in MS-Access and then retrieve the values to keep track of the...
3
by: Mohammed Mazid | last post by:
Hi folks! Can anyone please help me with this? I am developing a Quiz program but I am stuck with "multiple answers". Basically I need some sort of code that would select multiple answers...
5
by: Simon Jans | last post by:
Hello I'm having serious troubles creating a seach form showing data from multiple tbls, I'll try to explain my problem using a simple example by the way I'm using Acces 2003 tblEquipment ...
1
by: Stinky Pete | last post by:
Morning, The Non-conformance file we use as part of our Corporate GMP Manufacturing complicance has a number of check boxes that users (7) can select when determining what category a...
1
by: G04 | last post by:
Hi All, I have a continuous form with all records. For each field there is a combo in the form header and the form also contains a Toggle button "Apply Filter". When clicked, it changes to...
8
by: hollinshead | last post by:
Hi there i have bit of an issue. i haver this database that is purely used for searching records under certain criteria. This criteria is chosen by the user on a form using list boxes and combo...
7
by: gerryis2000 | last post by:
i have a list box called Items which i want the user to selct items from. how can i make the selection by ticking check boxes rather than pressing ctrl key and the mouse. thank you
4
by: beaker213 | last post by:
I have created two unbound boxes on a form that users can enter name and date . I want the form to filter by name and the "YYYY" part of the date. I have researched the forum and found most...
1
by: Hope Valley | last post by:
I want to make a query and the field had check boxes. I want only the checed boxes in the field, not the unchecked boxes. What do I put in the criteria to get this
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.