Multiple Criteria From Form

Feb 10, 2008

I have a form that has seven unbound fields named txtCityCriteria1 through txtCityCriteria7

The idea is to have the use type in up to seven cities and have this applied to the criteria of the city field in a query. This query is the datasource for a report. I know how to do a single text ....

[Forms]![frm_OpenReport]![txtCityCriteria1]

in the criteria row would do the job. But how can I do seven?

Oh and if all are left blank i need it to open another form that informs them of their mistake.

I have looked through these forums and have found several possible solutions but I can not get any to work. Any assistance would be greatly appreciated. Take it easy on me I am relatively new to this code thing. Used to do everything in macros.

View Replies


ADVERTISEMENT

Multiple Criteria Set Via Form Field...

Mar 24, 2005

Hello,
...I'm not sure if I'm making this question more complex or not or if it's even possible? (I would think so) Anyway...What I am trying to do is create a form in which I can input more than one criteria into a field - We will cal it txtSetValues. Then via a button open a query that will use txtCode as the criteria for searching records in a table. The
table is called: tblMASTERTABLE-EmpCount
query is called: qryEmpCount

The table currently only has two field; ORG and Name. The criteria I have in ORG is: Like [Forms]![frmEmpCount]![txtCode]
I currently can find any specific ORG just fine. I can also use the wildcard and that works fine. But how can I set it up so that I can enter in multiples... For example, I would like to find all employees that there org is either; AL001 OR AL010 OR AL100 - The wildcard will 'Almost' do it in some circumstances, but it may gather some orgs that I don't want in this list. I hope I am explaining this in an easily understood fashion?

Thanks,
---roystreet
P.S. Now I know I could just make multiple fields in the form (ie; txtCode2, txtCode3,etc) and then just add those as criteria in the query, but I was hoping that I wouldn't have to do that.

View 1 Replies View Related

Opening Form On Multiple Criteria

May 19, 2005

I have a patient form that has a subform showing the care plans. At the side of each care plan for that patient i have a button that if clicked will take you to the specific care plan. I need this to open the care plan form based on multiple criteria which is

Date (Date Field)
Care Plan Number (Numeric Field)
Patient number. (Text field)

These fields are all on the subform and will be populated.

Any ideas? :confused:

View 4 Replies View Related

Multiple Criteria In Query By Form

Feb 8, 2006

Hello all,

I have a form that feeds a query with information, in my query I have this:

[Company] Like [Forms]![QBF_Form]![Sales] & "*" Or [Forms]![QBF_Form]![Sales] Is Null

When I fill in a value in the field e.g. "data*"the query brings up all information with the word "data" in it.

However, when I fill in something like "data* or vent*" I don't get any query results.

How do I change the query expression above so I can search for multiple criteria in one field using "or"?

Thanks a lot for your help!

View 2 Replies View Related

Select Multiple Criteria For Query On A Form

Oct 14, 2005

I was searching through here looking for a solution to the following problem:
I am building a Capacity database for work. The requirements require that users be able to sort by numerous criteria (Forecast Date, Portfolio, Market, Bucket, Month), all from a simple form that will spit out the results. Rather than creating unique queries for each combination of criteria(way too many!) or creating the SQL text in VBA, I played around until I came up with the following(which may have been done already, but I can't find it on here, so I'm not claiming to be brilliant...LOL). I have dropdowns on my form for each sort criteria-(Forecast Date, Portfolio, Market, Bucket, Month)

Then I created a query and for each criteria, I put this in:
Like (IIf(IsNull([Forms]![frmWAOFAdjustments]![Bucket]),"*",[Forms]![frmWAOFAdjustments]![Bucket]))

So if the user leaves a dropdown blank, the query simply brings back all the results from that field (Like *).

The text in bold is simply replaced with the dropdown name for each segmentation criteria. Next to each dropdown is a button that clears the dropdown box and requeries the listbox with the results(in case the user doesn't want to remove a criteria. This makes running searches for a specific number of accounts easy for the user and easy on me..lol.

Hopefully this can help someone out with a similar problem. I have learned so much from this forum, I just wanted to give something back. If anyone has any questions on this, just let me know.

View 2 Replies View Related

Forms :: Sum And Count On Multiple Form Criteria?

Apr 19, 2013

I have a form lets call it 'Customer' and I have a table called orders how can I write 'Excel like' Countifs and sumifs formulas? I have been trying the IIf functions I believe correctly but am not getting the results expected or rather nothing at all!

What I am wanting to do is for example look at the table 'orders' and count all 'orders' which are for the 'Customer' in the active form this field is imaginatively called 'Customer Number' and 'orders' that are for simplicity 'rocks'

Basically if the client in the active form exists in the orders field count how many times they have placed an order for rocks.

View 1 Replies View Related

Modules & VBA :: Multiple Criteria To Open A FORM

Apr 17, 2014

How to open FORM which has "inner join" in source?

Code:
...
Dim idRS As DAO.Recordset, ShowIdentity
strSQL = "INSERT INTO tblZlecenia (id_zlecenia_info, DataPrzyjecia) VALUES ('" & _
ostateczne & "', " & _
Format(Date, "#mm/dd/yyyy#") & ")"

[code]....

View 5 Replies View Related

Queries :: Set Up A Query By Form With Multiple Criteria

Jul 29, 2015

I am trying to set up a query by form with multiple criteria.For the majority of the criteria I'm using the format: Like [Form]![formName].[txtInputboxName] &"*" .

I copied the Like (...) &"*" from someone else in order to allow for multiple, optional criteria, which does do the trick, however I don't understand why.

I now want to set up a criteria on my query to search for values between two input values to gives the records in the range e.g between 50 and 100 Following the above format, I want to put something that achieves this:

Between Like [Form]![formName].[txtInputboxName1] &"*" AND Like [Form]![formName].[txtInputboxName2] &"*"

with Inputbox1 being 50 and Inputbox2 being 100, however that code doesn't work and I don't know how to get around it as it keeps giving the 'incorrect syntax' error.

View 5 Replies View Related

Print Report From Form Based On Multiple Criteria?

Nov 17, 2006

Hi,

I have the following code which i found on another thread on this forum (thanks to original author) which is attached to the On Click of a button which prints the report corresponding to the details displayed in the form.

Dim strCriterion As String
Dim strMsg As String, strTitle As String
Dim intStyle As Integer

If IsNull(Me![ReferenceNumber]) Then

strMsg = "You cannot print a Blank Form!!."
strTitle = "Print Error"
intStyle = vbOKOnly
MsgBox strMsg, intStyle, strTitle

Exit Sub
End If

If Me.Dirty Then
Me.Dirty = False
End If

strCriterion = "[ReferenceNumber]=" & Me![ReferenceNumber]
DoCmd.OpenReport "DoC Certificate", acViewNormal, , strCriterion

This works fine, however, i need to be able to select the report based on more than 1 criteria. For example, the Reference Number can be repeated but is distinguishable from each other by an Issue Number i.e. ReferenceNumber = 93, Issue 1 or 2 etc. At present when i run the above it prints all versions of, in this case, reference number 93, which given that each report is only a single page isn't a show-stopper but it would be nice to have it working as i would like.

I have tried adding to the strCriterion line such as strCriterion = "[ReferenceNumber]=" & Me![ReferenceNumber] and "[IssueNumber]=" & Me![IssueNumber] but no joy. I have tried bracketing the whole line and variations thereof, again no joy.

Can anybody tell if what i am attempting to do is possible and if so how do i go about it?

I have tried the above coding using MasterID which is the Autonumber PK but it produces an "Enter Parameter Value" box for MasterID. Obvioulsy if i can get it to work for the Autonumber then my problem goes away but i can't seem to figure out why it works for Reference Number (Number) and not MasterId (Autonumber)?

Regards

Alan

View 5 Replies View Related

Modules & VBA :: Query Data Using Multiple Criteria From A Form

May 29, 2014

I have a form where varying layers of information can be entered. In some cases, a user may know all information or only part. If i tie the query to the form, each field has to be populated for it to work. how do i set the query up to effectively use the information available and not require all information?

I have tried setting VBA code as follows:

If Me.Combo1 = Null Then Me.Combo1 = "*"

However, when i do this, it updates the form field with an asterick/wild card but does not include in query. yet, when i update the form fields with data (not asterisk/wild card) the query runs.

View 13 Replies View Related

Create A Query That Has Multiple Criteria Selected From A Form?

Nov 26, 2013

I need to create a query that has multiple criteria selected from a form For example. I will always have the customer name but then the user might also choose any one or more of the following, start date, end date, number etc

I have tried to create a select query and added the customer form element to the criteria but I am not sure how to do the rest because it will always have at least one more criteria but I am not sure which one and it may have up to 5 more criteria.

View 5 Replies View Related

Form For User To Create Custon Reports From Multiple Criteria

Jan 4, 2006

I am trying to put together an form to be used in an academic administration database.
Ideally, I would like to create a form that will allow a user to select criteria and get a list of all students fitting that criteria.
For example:
Show me all a) all Economics majors with b) 30-50 Credits who c) have not taken English 101.
All of this data could be compiled into one query, but I would like to create a form that will allow a user to select what data he or she would like to see.
(Maybe they only want to see graduates)
I hope this makes sense.
And I hope someone can help point me in the right direction.

Thank you!

View 2 Replies View Related

Queries :: Criteria From Multiple Combo Boxes On User Form?

Sep 29, 2014

I have a user form with six different dropdown boxes. I would like to create a query that gets its criteria from users selecting values from one or more of these boxes.

I have tried:

[forms]![frmName]![comboboxname] or [forms]![formName]![comboboxname] is null

in the corresponding query fields and get a "query is too complex" error message, even when only selecting one criteria.

What am I doing wrong?

View 5 Replies View Related

Form Based Parameter Query With Multiple Controls Used For One Criteria

Nov 14, 2012

My form-based search mechanism uses controls to set the parameters for the query data source.

I have one field call quantity in stock. I could you a Between and And method to allow the end user to input the stock quantity they want.

HOWEVER, i would love it for the user to first select the Comparison Operator (e.g. > , <, >=, <=) from a combo box and then in an adjacent text box, enter the quantity.

The expression i entered in the query goes something like this.... Forms![frmSearch]![cboRange] & [Forms]![frmSearch]![txtQuantity]

When i try and run this, i get the message "THe expression is too complex to be evaluated".

View 5 Replies View Related

Forms :: Preventing Double Booking Of Room In Form Based On Multiple Criteria

Aug 13, 2015

I have Table for rooms called Rooms, and the data in the table is roomNumber which is in the format Letter and two Digit number, so A01 would be dorm building A and room building 1, and I then have a seperate row named roomType that is either VIP or Semi Private.

Now I am creating a form where a worker will put in there scheduledCheckin date and scheduledCheckout date and it will be written to the Bookings table. I would like this form however to take the dates they have put in, as well as room type (Semi-Private or VIP, and assign them an available room that isn't booked at all in that range) or list all available rooms for that range of time and they could then just select the room. I would rather it automatically assigns an available room based on room type though because this check in system is going to have about 500 rooms.

I've attached a link for what I have so far. I know how to make a query to list anyone who has booked rooms over that date, but need one for just preventing booking the same room.

[URL] .....

View 3 Replies View Related

Queries :: How To Count Records Based On Multiple Criteria From Multiple Tables

Jan 4, 2014

I need to count records based on multiple criteria from two different tables. I have two tables (i.e. "tblTasks" and "tblTaskHistory"). The tables have a one-to-many relationship based on the "TaskID" field. "tblTasks" has a field called "AssignedTo" and "tblTaskHistory" has a field called "TaskStatus". I need to know how many tasks have been "reopened", the "reopened" status is located in the "TaskStatus" field in "tblTaskHistory". I need this count against a unique listing of employees which can be found in the "AssignedTo" field in "tblTasks".

View 4 Replies View Related

Is It Possible To Choose No Criteria On A User-defined Criteria Form?

Sep 15, 2005

I created a form that allows the user to choose the criteria that they want to see on a report using =Forms!formname!controlname in my query. It works great but I want to also allow the user to choose nothing and return all records instead of limiting them to choose just one type of record. Is this possible? Before I created the form my query had the [Enter parameter] on one criteria line and [Enter parameter] Is Null on the next criteria line and that was working great for my use but I need to create a simple form for other users.

View 1 Replies View Related

Multiple Criteria

Jun 22, 2005

Is it possible to have more than 9 OR criteria in an update query?

Thanks,
SKK

View 1 Replies View Related

Multiple Criteria

Jul 20, 2005

hi. my name is tim. im having some problems with a query that I am writing. it should be rather simple and involves only one table.

the table is called tblCustomer. The query involves 2 fields: cResort and cWeek. Neither of these fields are unique. Together they make up the primary key.

cResort is populated with a textfield: PF, PV, and GS.
cWeek is populated with an integer: 1-52 (the number of weeks in a year)

This is what the query is supposed to do:
SELECT tblCustomer.*
FROM tblCustomer
WHERE cResort DOES NOT EQUAL "PF" AND WEEK is LESS THAN 10

here's where the problem lies, this filters out ALL "PF" and ALL cWeek < 10.

I want PF's with a corresponding cWeek from 1-10. I dont want to see PFs with corresponding cWeek 11-52.

Example:
Show me cResorts: PF with corresponding cWeek:1-10.
Do NOT show me cResorts: PF with corresponding cWeek:11-52.

Is this clear? Thank you for the help.

View 6 Replies View Related

Multiple Criteria

Mar 29, 2006

I am trying to construct a fairly complex query on the fly. I have it working except for the criteria side of the query which I am having trouble with. It doesn't really matter about the vb side of it because I can alter the construction easy enough. it is more a question of how I get the criteria right.

I'll show you the SQL below first:

SELECT DISTINCTROW tblCandidate.CandidateID, tblCandidate.FirstName & ' ' & [Surname] AS Name, tblCandidate.Telephone, tblCandidate.Mobile, tblCandidateAvailability.Status, tblCandidate.CandidateID AS [Count]
FROM ((tblCandidate LEFT JOIN tblCandidateArea ON tblCandidate.CandidateID = tblCandidateArea.CandidateID) LEFT JOIN tblCandidateJobCode ON tblCandidate.CandidateID = tblCandidateJobCode.CandidateID) INNER JOIN ((tblBranchDetail RIGHT JOIN (tblCandidateAvailability INNER JOIN tblBooking ON tblCandidateAvailability.AvailableDate = tblBooking.ScheduleDate) ON tblBranchDetail.BranchID = tblBooking.BranchID) INNER JOIN tblBookingDetail ON tblBooking.ScheduleID = tblBookingDetail.ScheduleID) ON tblCandidate.CandidateID = tblCandidateAvailability.CandidateID
WHERE (((tblCandidateAvailability.Status)='Available') AND ((tblBookingDetail.ScheduleDetailsID)=103) AND ((tblCandidateJobCode.JobCode)='DO') AND ((tblCandidateArea.PostCodeID)='HP')) OR (((tblCandidateAvailability.Status)='Available') AND ((tblBookingDetail.ScheduleDetailsID)=105) AND ((tblCandidateJobCode.JobCode)='DO') AND ((tblCandidateArea.PostCodeID)='DO')) OR (((tblCandidateAvailability.Status)='Available') AND ((tblBookingDetail.ScheduleDetailsID)=106) AND ((tblCandidateJobCode.JobCode)='DO') AND ((tblCandidateArea.PostCodeID)='HP'));

The table structuring is fine it is the SQL after the WHERE statement that I am having trouble with.

This query works fine to give me all Candidates that comply with these criteria. The only trouble is I want to only results where the Candidate(s) ALL three set of criteria. I have tried replacing the OR with AND and using extra brackets to enclose the whole WHERE statement to imply I need all criteria met but this reports back no results despite me having test data where a candidate meets all criteria.

I am sure this is not as hard as I am making it but I can't figure it out at all.

I also ideally wanted to show only one record (ie one candidate that meets all instead of three records showing the candidates). This is not so important as I can work this out easily enough, by probably hiding fields I don't want to see and showing only unique values, etc...

Can anyone help me with this?

Thanks in advance,

Daz

View 14 Replies View Related

Multiple Criteria Using IIF

Apr 8, 2006

:eek: I am looking for a method that works in query criteria (NOT HARDCODING SQL) as i am quite new to this.:eek:

i have two fields for query to lookup, firstname and lastname.

THE FIRSTNAME FIELD:

IIf(IsNull([Forms]![frmSearch]![FirstName]),"",[Forms]![frmSearch]![FirstName])

THE LASTNAME FIELD:

IIf(IsNull([Forms]![frmSearch]![LastName]),"",[Forms]![frmSearch]![LastName])



Intended operation;
1) The value is seen on my search form (frmsearch) and returned to FIRSTNAME and LASTNAME query fields as NULL or VALUE.

2) If on the search form FIRSTNAME has value and LASTNAME is NULL then query should lookup a record with valid FIRSTNAME and nothing in LASTNAME.

3) If on the search form LASTNAME has value and FIRSTNAME is NULL then query should lookup a record with valid LASTNAME and nothing in FIRSTNAME.

4) If on the search form FIRSTNAME and LASTNAME have value (NOT NULL) then lookup record with valid FIRSTNAME and LASTNAME.

5) If no information is entered on the search form then "enter some information" as message box.

6) I would want wildcard using which also doesn't seem to work in IIF statement. e.g. "*" & [Forms]![frmSearch]![FirstName] & "*"

THERE FORE ---> IIf(IsNull("*" & [Forms]![frmSearch]![FirstName] & "*"),"","*" & [Forms]![frmSearch]![FirstName] & "*")



ONLY NUMBERS ABOVE (2) (3) AND (6) DO NOT WORK, IF ANYONE COULD GIVE SOME LIGHT ON THIS I WOULD BE VERY GRATEFUL, AS I AM IN THE BLUE ON THIS.:rolleyes:

TAKE IT EASY:D

View 3 Replies View Related

Multiple Search Criteria

Apr 26, 2005

Wonder if you guys can help me with something. I have a table with about 1200 guests, what I want to do is to search the table base on different criteria (or combination of criteria), namely phone #, name, street name, and postal code. Not everyone has all this info, and their names aren't separted into proper lastname or firstnames (old data).

What I want to do is to be able to type in a person's first name, last name, or both (an maybe other info if the first search wasn't successful).

http://www.psynic.com/files/access.jpg

What should I do to implement this? I was thinking of running 4 different queries, and interesect them into the final query. What do you think?

View 2 Replies View Related

Dcount With Multiple Criteria

May 16, 2005

Not sure if this belonged in reports or queries, so I chose general. I have looked at several DCount threads but haven't quite found my answer. I want to use Dcount in an unbound textbox in a report. It counts the number of records in another table - comparison
the first part of the statement works fine ( up to 'iss'"). When i added the between date part i'm not getting any # returned in my report. I want to addthe criteria of RecDate between the 2 dates on the open form.
Can anyone tell me where my problem lies? ( if this makes sense)

Thanks
Kevin


=DCount("[type]","comparison","[type] Like 'iss*'" And ("[comparison].[RecDate]" Between Forms!DateInputforRMAsReturned!Text0 And Forms!DateInputforRMAsReturned!Text2))

View 14 Replies View Related

Multiple Criteria In Query

May 14, 2005

Hello all:

I need your urgent help with the following:

I am setting up a query in access. I have about 4 criteria for one of the fields called Center, I want the query to do the following:

Return all rows if:
Center is Like 6101*
Center is Like 61HKS56800
Ignore row if Center is Like 6101D*
Ignore row if Center is like 6101SALM01

I put in the following and I am not getting the correct results:

Like "6101*" Or Like "61HKS56800*" And Not Like "6101D*" And Not Like "6101SALM01"


Thanks,
Odun

View 1 Replies View Related

Multiple Grouping Criteria

May 30, 2006

I am trying to produce a report or query that lists 11 attributes for several projects measured each month over the duration of each project. i.e. It is required to have the attributes for project A listed (horizontally) for months 1,2,3,...etc (vertically) followed by those for projects B for months 1,2,3,4,5,6... etc. Can anyone advice on how to do this please?

View 2 Replies View Related

Query With Multiple Criteria

Aug 24, 2006

Hi all,

I'm working on a purchasing app in access. At this point i'm working on the reporting module. I want a user to be able to fill out a start date (text box), end date (text box), and select a code from a list, hit Run Query, and have it pull up a report listing the date that the selected code was used, between the start and end date, and display other info as well.

The problem i'm having is that i can get the date ranges to work, or the code to work, but not both of them. Here's what i have in my query:

http://content.imagesocket.com/images/gl_codes2ff.JPG

I'm really lost here. Any advice would be appreciated.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved