Criteria Parameter in query for two fields: help

I have a form that utilizes two contact lists in separate combo boxes to 
illustrate projects that multiple people have worked on. 

I am trying to make it so that a report will illustrate the associated data 
based on these contacts.  

The selection will be based on either one contact (from either list) or 
both.  Whereby on selection, the report will generate the associated data 
based on these user names.

How would I go about creating a parameter in the query so that it will limit 
the content to reflect either contact list or a combination of the two?

I am a beginner to Access and would greatly appreciate any detailed 
responses.  
0
Utf
4/15/2010 6:11:02 PM
access.gettingstarted 618 articles. 1 followers. Follow

1 Replies
1210 Views

Similar Articles

[PageSpeed] 33

Open the query that you form is based

In the column that contains that details of the people (who you filter using 
the 1st combo box on your form) add this to the criteria row

Forms![NameOfForm]![ComboName] Or Forms![NameOfForm]![ComboName] Is Null

Note change NameOfForm and ComboName to what they really are

Do the same in the criteria row of the other column (that contains details 
of the 2nd group of people that want to filter the form on)

Save the query.

Next open the form in design view and add a button
Use the wizard if you want
In the code behind the button's OnClick put  
Me.Requery

Save

Give it a try


*******************************

You don't really need this,  but if you are interested
All the below may look a little complex but it's quite easy to do.
The sql of your query would look like this

I assume that
You have 2 tables called tblTable1 and tblTable2
Your have a form called frmMyForm
In frmMyForm you have 2 combos called cboMyCombo1 and cboMyCombo2
You have a query called qryMyQuery


SELECT tblTable1.SomeFieldInTbl1, tblTable2.SomeFieldInTbl2
FROM tblTable2 INNER JOIN tblTable1 ON tblTable2.SomeFieldInTbl2 = 
tblTable1.CDClientID
WHERE (((tblTable1.SomeFieldInTbl1)=[Forms]![frmMyForm]![cboMyCombo1]) AND 
((tblTable2.SomeFieldInTbl2)=[Forms]![frmMyForm]![cboMyCombo2])) OR 
(((tblTable2.SomeFieldInTbl2)=[Forms]![frmMyForm]![cboMyCombo2]) AND 
(([Forms]![frmMyForm]![cboMyCombo1]) Is Null)) OR 
(((tblTable1.SomeFieldInTbl1)=[Forms]![frmMyForm]![cboMyCombo1]) AND 
(([Forms]![frmMyForm]![cboMyCombo2]) Is Null)) OR 
((([Forms]![frmMyForm]![cboMyCombo1]) Is Null) AND 
(([Forms]![frmMyForm]![cboMyCombo2]) Is Null));





-- 
Wayne
Manchester, England.



"Rx87" wrote:

> I have a form that utilizes two contact lists in separate combo boxes to 
> illustrate projects that multiple people have worked on. 
> 
> I am trying to make it so that a report will illustrate the associated data 
> based on these contacts.  
> 
> The selection will be based on either one contact (from either list) or 
> both.  Whereby on selection, the report will generate the associated data 
> based on these user names.
> 
> How would I go about creating a parameter in the query so that it will limit 
> the content to reflect either contact list or a combination of the two?
> 
> I am a beginner to Access and would greatly appreciate any detailed 
> responses.  
0
Utf
4/16/2010 7:11:02 AM
Reply:

Similar Artilces:

RMS-F3 Calculator result pastes into numeric field on POS screen
A feature allowing the value result from F3 Calculator to update the quantity field in RMS Store Operations. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=ff3bc4de-176b-4...

Separating strings in a field to separate fields
Hi, I have a field that consists of a string value that looks like Item1, Item2, Item3, each item is separated by commas. I want to separate that string value so that each item has its own field. Is there code that will easily do this? Thanks, Jaime On Wed, 5 Dec 2007 12:08:57 -0800 (PST), jseger22@yahoo.com wrote: >Hi, > >I have a field that consists of a string value that looks like Item1, >Item2, Item3, each item is separated by commas. I want to separate >that string value so that each item has its own field. Is there code >that will easily do this? > >Thank...

adding and counting Help!! #2
Just to add, I'd like to sort the dates 2004.10.01 to 2004.10.31 whe doing the sum of dollar amount -- alexm99 ----------------------------------------------------------------------- alexm999's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=491 View this thread: http://www.excelforum.com/showthread.php?threadid=27264 alexm999 Wrote: > Just to add, I'd like to sort the dates 2004.10.01 to 2004.10.31 whe > doing the sum of dollar amount. Assuming that dates are true dates... =SUMPRODUCT(--(CodeRange=101),--(AdvertisingRange="TV"),--(TEX...

Outlook 2003 Add-on help
Is there a way, either built-in to Outlook 2003 or through third party software that will display contacts in a alphabetical list when composing a mail message? Specifically, the user wants to be able to select a letter, e.g. "A", "B", "C", etc... when composing a message (when clicking the "To" field in the mail form) that will pull up an alphabetical listing of contacts from the address book. I know this capability resides in OWA, but I have yet to find a solution for Outlook 2003. Any assistance would be greatly appreciated. Thanks, Ryan ryan.hopm...

Help: my reminders don't work
Help: I'm running OL 2003 on WinXP pro connected to an exchange server. I run this configuration on both my laptop and my desktop. On my desktop the calendar reminder pop ups and alert sounds don't work but they do on my laptop. As far as I can tell, the configuration is identical. I've tried the /cleanreminders and /resetfolder switches, but the don't make any difference. Any advice appreciated. Thanks. -- Dab Cut off: yourhead to respond Have you checked your Sounds and Multimedia options on the desktop to ensure that your sounds are working correctly and th...

In Publisher "Help" there is nothing about inserting FOOTNOTES or.
How do you insert footnotes or endnotes in Publisher? Hi pastorcam (pastorcam@discussions.microsoft.com), in the newsgroups you posted: || How do you insert footnotes or endnotes in Publisher? You need to create them manually. Publisher does not offer footnote/endnote features. -- Brian Kvalheim Microsoft Publisher MVP http://www.publishermvps.com This posting is provided "AS IS" with no warranties, and confers no rights. ...

why csv fields converted into dates
Hi I have a csv file with fields that look like this ,"20-10", this is being interpreted as a date when i open it in Excel. what do i need to do with this filed in order to make Excel consider it a text? I tried replacing the double quotes with a single quote like this: ,'20-10', but that makes the single quote appear in the cell in Excel, which is not what i want. please help. thanks hilz wrote: > I have a csv file with fields that look like this > ,"20-10", > this is being interpreted as a date when i open it in Excel. Hmm, that&#...

Loosing Data-Help needed
Hi All, I have an huge spreadsheet with macros on it, which is continuously updated. Off recently my spreadsheet is loosing the data i.e. I will have 2-3 days old information, all the updates that we made recently is lost. I am saving the spreadsheet every 15-20 mins still it is doing it. Could anyone please help me :confused: . Thank You, Naveen -- neomemphis ------------------------------------------------------------------------ neomemphis's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=33240 View this thread: http://www.excelforum.com/showthread.php?th...

Serial Number
I have a table with fields: DT, INVOICE, AMT Now invoice numbers are different unique keys but not numeric, how to add a fourth temporary column in a query to insert serial numbers as well like: Serial, DT, INVOICE, AMT 1 2 3 4 .... -- Thanx & Best Regards, Faraz! hi Faraz, On 01.03.2010 09:07, Faraz A. Qureshi wrote: > Now invoice numbers are different unique keys but not numeric, how to add a > fourth temporary column in a query to insert serial numbers as well like: > > Serial, DT, INVOICE, AMT > 1 > 2 > 3 > 4 Using DCount(): ...

Form Customization
Dear All, Can anyone help me? I want to make a field cannot be editted by user. Like Quote ID. But I dun know how. I am a new comer. I hope all of you can understand what I am saying, cause my English not so good. Thx, Monalisa Hi Monalisa, As far i know you cannot make a form field non-editable. I guess Microsoft will come up in the future releases. Regards Vijay "Monalisa" wrote: > Dear All, > Can anyone help me? I want to make a field cannot be editted by user. > Like Quote ID. But I dun know how. I am a new comer. > I hope all of you ca...

Column Sum in Footer
Hi, I have created a Tabular report that lists names and weights for different people. I want to create a stand-alone field in the page footer that will display the SUM of all the weights on the report. Can somebody please help me? (I'm using Access 2000 btw) I have tried creating a text box with the Control Source property set as "=Sum(weight)". However, this just produces an error. Thanks in advance. Julie Smith wrote: >Hi, >I have created a Tabular report that lists names and weights for different >people. I want to create a stand-alone field in the page f...

Help! #12
It repeatedly asks for my network password.And doesnt recognise it when i enter it. I havent changed the password from the original. Has this happened to anyone else? Does anyone know how to fix it? Do you mean that Outlook keeps asking for your Outlook password? Check CapLocks, etc. I believe Outlook passwords are case specific. "Leslie" <anonymous@discussions.microsoft.com> wrote in message news:03c601c496bc$95bd84a0$a401280a@phx.gbl... > It repeatedly asks for my network password.And doesnt > recognise it when i enter it. I havent changed the > password from ...

Query
Hi Good Morning, I currently have a query that displays six columns: Company | Product1 | Product2 | Product3 | Product4 | Product5 So one row displays one company with five different products. What I need is some kind of query that will display the data like this: Company | Product1 Company | Product2 Company | Product3 Company | Product4 Company | Product5 Basically the same company would be shown five times (on different rows) with the different Products on each. I'm sure there's a way to do this with a crosstab but I could do with so...

Displaying all of the fields for a record chosen in a combo box
I run projects for retail customers. I have a form that allows me to see all of the phases of the project at once. I cannot figure out how to display the entire record of the particular unit on which I am working. Subforms haven't worked as I need to choose from a master list each time. Any help on this would be greatly appreciated. Ed Owen On Fri, 8 Feb 2008 07:49:02 -0800, Ed3 <Ed3@discussions.microsoft.com> wrote: >I run projects for retail customers. I have a form that allows me to see all >of the phases of the project at once. I cannot figure out how to displ...

Unlinked Tables affecting Query?
I have a simple SELECT query which is based on two tables with an INNER JOIN on the VehicleID field. I noticed however, that if I added another table to the QBE grid - even though I didn't link the table to my query's 2 source tables in any way, and even though the query's SQL remained unchanged - the query output changed?? It returned the same records, but repeated hundreds of times? Can anyone explain why just the presence of an unlinked table in the QBE grid would affect a query? I just can't explain it. Any help greatly appreciated.......Regards, Jason Jay If yo...

opening file problem please help
When I click on an Excel file in Windows Explorer, I get the following error message. "a document with the name "filename".xls is already open. You can not open two documents with the same name at the same time". (Clicking ok closes the message and the file opens.) This happens on every Excel file in Explorer. There are no other files open on my p.c. at all. If I open Excel first and open the file I want by clicking the File menu and selecting Open, the file will open with no error message. Other than that the programme works perfectly I'm using Excel 97 and Windo...

Charting challenge/query
The following quote is posted on behalf of a client using Windows and Office 2003 Standard. Please email responses directly to me, too, since I do not read this group much. Any help/insight would be most appreciated. I'll do my best to relay any questions people have and bring back any answers to said questions. <quote> The Goal: In an effort to come up with a new way of looking at organizational structure, I employed Excel's 'Donut Chart' function. My goal was to have the head of the organization in the middle of the chart and then that person's direct re...

Populate comboboxes based on query
I have a textbox on a form that user will enter a string into and press a button. An example of what they will enter is "BD532313CW". Once they press the button i take the first three numbers (532 in this case) and assign them to a string variable named myString. Next I have 2 combo boxes on a form named cmbAcct and cmbDisp. I have a table named "Swbs" that has three fields in it Swbs.Acct, Swbs.Disp, and Swbs.Num. There are duplicates in all fields. I need to populate cmbDisp with the distinct data in Swbs.Disp where Swbs.Num = myString. Likewise I need to populate c...

function in query summing results of 2 switch functions?
can I build an expression in a query that sums the values of 2 computed fields in the same query. E.g, Sum(1-CF_1 + CF_2) ? CF_1 & CF_2 are 2 other fields that use Switch statements. THanks Zx slight correction. Can I do this in the Field builder window: field_B: (CF_1 + CF_2) if both CF_1 & CF_2 are computed fields in the query themselves (basically fields computed from switch statements). Access is giving me an error saying it does not recognize these as "a valid field name or expression". I'm not sure why - aren't they expressions :) ? ...

Reports Columns Help/Field Name Help
Hello, I wrote in previous to get information on makin a 3 column report w/out Fieldnames repeating. The code worked and it is listed below: If Me.Left < (2 * 1440) Then Me![FirstNameLabel].Visible = True Me![LastNameLabel].Visible = True Me![TitleLabel].Visible = True Me![FirstName].Visible = False Me![LastName].Visible = False Me![Title].Visible = False Me.NextRecord = False Else Me![FirstNameLabel].Visible = False Me![LastNameLabel].Visible = False Me![TitleLabel].Visible = False Me![FirstName].Visible = True Me![LastName].Visible = True Me![Title]...

Help !!!!!! Excel 97 keeps crashing out of my file.
I have a workbook that has been in existance for several years and is continually being developed. After adding some additional graphics I suddenly started to get The Program error Dialog Box : "Excel.exe has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created". I've deleted the graphics and I continue to get the error whenever I try to copy to the clipboard. I am running Excel 97 under Windows 2000 on A DEll Latintude 640 laptop. Any one any suggestions as to what has happened and how I can rescue the situation? The...

exchange help #2
hi guys, im having a problem on exchange where some boxes can receive mail and others cant, and then other times it gets inverted and the ones that couldnt now can and visa versa any ideas where i can start looking? thx in advance Start by describing your environment. Single 2003 Exchange Server? FE/BE? Outlook 2003 Clients? All mail having problems, or just external? Any error messages in the event logs? What exactly does the client see? David A. Bermingham, MCSE, MCSA:Messaging Senior Systems Engineer www.steeleye.com squij...@hotmail.com wrote: > hi guys, > im having a probl...

Query-Based Distribution Groups #2
I'm looking to create an LDAP query in Exchange 2003 that will show domain users that are currently logged on. This will allow me to create an email distribution group that contains only people who are in the office at that moment. Surely this must be possible as the query is searching Active Directory, but I've not been able to find a "logged on" attribute and I've trawled the web and newsgroups for answers but found nothing ... if anyone knows how to do this, I'd be very grateful of your help! Thanks, Rob "Robert Stokes" <rob@robertstokes.net...

install excel 2002 on two computers
can i install the above on 2 computers. I tried and it tells you to register it or it will self destruct after so many uses. I have already registered it on 1 computer. lew boone LEWISBOONE@ peoplepc.com Lew I believe you mean "activate" rather than "register". Read the EULA. One computer. One installation. Two computers. Buy a second copy of Office. Gord Dibben XL2002 On Tue, 18 Nov 2003 15:38:48 -0800, "lew boone" <LEWISBOONE@peoplepc.com> wrote: >can i install the above on 2 computers. I tried and it >tells you to register it or it wi...

Combine two different chart styles on one chart
I would like to combine a stacked bar chart with a normal bar chart on one chart. For example, I have the following data: Domestic sales $1,000 International sales $2,000 Intercompany sales $3,000 On one chart, all next to each other I want: 1. each of these data as a normal bar chart (3 bars in total) 2. all three combined on a stacked (multi-color) bar Any ideas on how to do this? Any help would be appreciated thank you in advance -- FXS Try one of the tutorials listed on this page: http://peltiertech.com/Excel/ChartsHowTo/ClusterStack.html - Jon ------- Jon Peltier, Microsoft...