473,466 Members | 1,301 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Multiple criteria in where clause to open a form?

99 New Member
Is the following statement correct/
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm Me.Name, , , "[A_PRIORITY] = '" & _ cboPrior & "'" AND "[A_LOCATION] = '" & _ cboLocate & "'" 
I am trying to give two conditions to open a form here.However nothing happens.
Mar 19 '12 #1

✓ answered by NeoPa

No. It has various problems, mainly related to what is inside, and what is outside, your string values.

Try something like :
Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.OpenForm(FormName:=Me.Name, _
  2.                     WhereCondition:="([A_PRIORITY] = '" & Me.cboPrior & "') AND " & _
  3.                                     "([A_LOCATION] = '" & Me.cboLocate & "')")

1 7001
NeoPa
32,556 Recognized Expert Moderator MVP
No. It has various problems, mainly related to what is inside, and what is outside, your string values.

Try something like :
Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.OpenForm(FormName:=Me.Name, _
  2.                     WhereCondition:="([A_PRIORITY] = '" & Me.cboPrior & "') AND " & _
  3.                                     "([A_LOCATION] = '" & Me.cboLocate & "')")
Mar 19 '12 #2

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

Similar topics

4
by: Barry Edmund Wright | last post by:
I would really appreciate your assistance. I am using Access 2000 to create a form that Lists Names and Addresses based on a number of selection criteria one of which is a combo box cboPCZip. All...
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("",...
1
by: BerkshireGuy | last post by:
Hello everyone, I am reading a query's SQL string and adding criteria to that and then resaving it. I know, might not be the best method, but it seems to work and there are some pros to doing...
2
by: dskillingstad | last post by:
I'm trying to set up a parameter query based on an unbound form. This search form has about 5 text boxes where the user can type in values within each box and search a specific table based on the...
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. ...
1
by: mtnbikur | last post by:
Lots of reading out there says you should only place “join criteria” in the join clause. That makes perfect sense. What about other search criteria? I’ve got other criteria, ie. cst_delete_flag =...
1
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
0
NeoPa
by: NeoPa | last post by:
Intention : To prepare a WHERE clause for multiple field selection, but to ignore any fields where the selection criteria are not set. ONLY WORKS WITH TEXT FIELD SELECTIONS. Scenario : You have...
0
Walt in Decatur
by: Walt in Decatur | last post by:
I have a form which is tied to a table with data for equipment belonging in a particular space (tbl_equpment_data). This form is actually a subform on a main form which also deals with other data...
2
by: AnnMV8 | last post by:
Hi, I'm hoping someone can help me. I'm not a programmer but found this really nice piece of code that I have been using but it needs to be altered. I had been getting help from Microsoft's...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.