473,387 Members | 1,757 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,387 software developers and data experts.

Multiple criteria from same fileld with combos in Form

Hi all. I^m trying to create a form in my customers database to display results by selecting values from combos or list boxes. The sample DB found in allen browne http://allenbrowne.com/ser-62.html website and I really like it. What I would like to do though is have the following.

<<<<This is the code for one combo.>>>> <<<<<<
Expand|Select|Wrap|Line Numbers
  1. 'Number field example. Do not add the extra quotes.
  2.   If Not IsNull(Me.cboFilterLevel) Then
  3.         strWhere = strWhere & "([LevelID] = " & Me.cboFilterLevel & ") AND "
  4.   End If
  5. >>>>>>
  6. I would like to have more than one combos like.
  7.  
  8. <<<<<<
  9. 'Number field example. Do not add the extra quotes.
  10.   If Not IsNull(Me.cboFilterLevel1) Then
  11.         strWhere = strWhere & "([LevelID] = " & Me.cboFilterLevel1 & ") AND "
  12.   End If
  13.   If Not IsNull(Me.cboFilterLevel2) Then
  14.         strWhere = strWhere & "([LevelID] = " & Me.cboFilterLevel2 & ") AND "
  15.   End If
  16.   If Not IsNull(Me.cboFilterLevel3) Then
  17.         strWhere = strWhere & "([LevelID] = " & Me.cboFilterLevel3 & ") AND "
  18.   End If
  19.   If Not IsNull(Me.cboFilterLevel4) Then
  20.         strWhere = strWhere & "([LevelID] = " & Me.cboFilterLevel4 & ") AND "
  21.   End If
  22.  
>>>>>>
I've inserted the code but is working only for one combo at the time.
Any suggestions are more than welcome and much appreciated.
Cheers.
Feb 24 '16 #1
2 900
NeoPa
32,556 Expert Mod 16PB
It's really not a great idea to express your question simply as code. An actual question written in English is far preferable.

However, if I do understand you correctly, you're after handling multi-field filtering using multiple ComboBoxes. This can be either cascaded (where one selection affects the contents of other ComboBoxes) or not. You should find what you're after in Cascaded Form Filtering or Example Filtering on a Form.
Feb 25 '16 #2
mbizup
80 64KB
You've posted this question on at least one other forum... You might find that you get more targeted responses by posting in one place, and responding promplty to the people trying to help (ie: collaborate!).
Feb 25 '16 #3

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

Similar topics

4
by: ShyGuy | last post by:
I have a table with 4 fields. Three are used for criteria. I can get the DLookup to work with 1 criteria with the following but can't get it to work with 2 or three. NumofAppts = DLookup("",...
3
by: developing | last post by:
Hello How do I specify multiple criteria for FindFirst or FindRecord (or anything else) that takes the criteria from a form. (text field and number field) edit: this will be in the after...
1
by: 2D Rick | last post by:
I want to open a report using OpenReport and passing it a Where Clause with multiple criteria. I know the Where Clause below is way off but it conveys what I need. Dates are of string type. ...
0
by: ChadK | last post by:
I am trying to open a report based on what the user selects on a form. Each individual criteria works but when I try to combine to pass multiple criteria it doesn't. I have read what I can find on...
1
by: akirekab | last post by:
I am using DCount, but I am not able to find how to set simple multiple criteria. Here is sample of what i need. =DCount("PatientProfileID","qryFaceToFaceReason_EAP_VG","FaceToFaceReasonID=2"...
7
by: DeZZar | last post by:
Hi all, Unfortunately I am quite a novice with Access!! I've created a number of data bases for my work however becuase my skills are limited to really built in functionality and wizards my...
3
by: kstevens | last post by:
Please help. I know the sysntax is wrong. Here are some details. I am looking for the sum of past shipped items. I originally wrote this Dsum with only one criteria, but because of multiple...
1
by: Brendan Wolf | last post by:
Happy Halloween all, I have been struggling at work with a DLookup using multiple criteria. I would like a text box to display the results of a DLookup based on the values selected in three...
3
by: Brendan Wolf | last post by:
Happy Halloween all, I have been struggling at work with a DLookup using multiple criteria. I would like a text box to display the results of a DLookup based on the values selected in three...
4
by: DANNYOCEAN | last post by:
I have a code that sucessfully calculates how many numbers are lower than for example 45 , for large sample number list. But i´m looking for a code that have a COUNT function with MULTIPLE...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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,...

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.