query help 01-08-08

My main table is called tblMain and this has an abundance of information in 
there. Each record has an ID called MainID. I need to do a 'search type 
query' on 4 fields . I have a primary business unit which each record must 
fill in (PrimaryBU). I then have another 3 related business unit fields 
(RelatedBU1, RelatedBU2, RelatedBU3). All 4 of these fields are linked to a 
lookup table tblBusinessUnit.

I need to write a query that will prompt the user to type a business unit (I 
know how to do this part) and will then show any record which has that 
business unit in any of those 4 fields.

Can you help please?

For example; the user will run the query and a prompt for the user to type a 
business unit will open. If the user types retail then any record which has 
retail contained in 
0
Utf
1/8/2008 9:40:00 AM
access 16762 articles. 2 followers. Follow

1 Replies
716 Views

Similar Articles

[PageSpeed] 16

Hi,
something like the following:
SELECT tblMain.MainID, tblMain.PrimaryBU
FROM tblMain INNER JOIN tblBusinessUnit
ON tblMain.MainID = tblBusinessUnit.MainID
WHERE tblMain.PrimaryBU = 'retail' OR
tblBusinessUnit.RelatedBU1 = 'retail' OR
tblBusinessUnit.RelatedBU2 = 'retail' OR
tblBusinessUnit.RelatedBU3 = 'retail' ;


Jeanette Cunningham

"rjw24" <rjw24@discussions.microsoft.com> wrote in message 
news:B7811813-B133-43A0-977D-87B5087CF9FB@microsoft.com...
> My main table is called tblMain and this has an abundance of information 
> in
> there. Each record has an ID called MainID. I need to do a 'search type
> query' on 4 fields . I have a primary business unit which each record must
> fill in (PrimaryBU). I then have another 3 related business unit fields
> (RelatedBU1, RelatedBU2, RelatedBU3). All 4 of these fields are linked to 
> a
> lookup table tblBusinessUnit.
>
> I need to write a query that will prompt the user to type a business unit 
> (I
> know how to do this part) and will then show any record which has that
> business unit in any of those 4 fields.
>
> Can you help please?
>
> For example; the user will run the query and a prompt for the user to type 
> a
> business unit will open. If the user types retail then any record which 
> has
> retail contained in 


0
Jeanette
1/8/2008 10:11:48 AM
Reply:

Similar Artilces:

Timer for Queries?
Does anyone know of a macro or add-on that I could use as a simple timer for queries? I don't like to use the CPU time in the Task Manager because of it's inaccuracy when not receiving full CPU usage. THanks for any suggestions -- cmungs Exactly what are you trying to accomplish? Are you trying to cause a query to run automatically every so often? If so, you will need to use the timer event on a form to do that. -- Lynn Trapp Microsoft MVP (Access) www.ltcomputerdesigns.com "cmungs" <cmungs@discussions.microsoft.com> wrote in message news:88EC7019-045F-4EF...

Hyperlink help #2
I have an array formula that creates a hyperlink:- =IF(K24=0,"",HYPERLINK("[inventory.xls]Inventory!a"&MATCH($A$1&$A24& $B24,Inventory.xls!$A$2:$A$10000&Inventory.xls!$D$2:$D $10000&Inventory.xls!$E$2:$E$10000,0)+1,"[inventory.xls]Inventory! a"&MATCH($A$1&$A24&$B24,Inventory.xls!$A$2:$A$10000&Inventory.xls!$D $2:$D$10000&Inventory.xls!$E$2:$E$10000,0)+1)) this works and creates the hyperlink:- [Inventory.xls]Inventory!a1 this works fine, but when the workbook inventory.xls is closed, nothing at all works when i clickon th...

Erratic results from query criteria
I am getting different results from running the same query with the same selections. One moment it is all behaving as expected, the next it has gone haywire. (I have done what appears to me to be EXACTLY what I have done in another database, where it works perfectly every single time.) In a query I have, amongst others, the following fields: Category SubCategory Company I want to be able to select any OR ALL of the relevant fields. I have the following criteria: Like "*"&[Type Category otherwise leave blank for ALL]&"*" Like "*"&a...

Excel 2003 Function Help
I need help coming up will a function that will average a range in one column based on if the hours match. Here is my set up. -------A-------B 1.....09:21....12 2.....09:46....24 3.....09:57....17 4.....10:04....22 I need to average column B if column A's hour is the same as the hour in a cell in another worksheet. Ryan Hicks wrote: > I need help coming up will a function that will average a range in one column > based on if the hours match. Here is my set up. > > -------A-------B > 1.....09:21....12 > 2.....09:46....24 > 3.....09:57....17 &...

help!! forwarding rules do not work!
Hello, i have set a rule so that when i receive from a certain sender, i have it set to forward to an email address that is outside the domain. but the rule will not forward it. it will sometimes work if i use the "run now" button but never automatically. what should i do. the altimate goal is to have message from certain people auto forward to a moble device's email account. thanks jon ...

Update Query ?
Is there a way to 1) Assign events when adding in data thru an update query for example if you append a bunch of data into a table could you then do some kind of an update query to say if there is an initial event and no others tag this one Renewal 1 etc.. the only real data you have to go on would be Customer A and the total amt .. the event, renewal event and the delta would all need to be added in example: Say Customer A comes in with an initial deal then Customer A renews their deal So, the data would look like when you're done.: Year Custo...

design query match anywhere?
In the design query I want to match the letters "ABC" anywhere in the column 'description'. I could not get instr to work by using: InStr(description, "ABC")) > 0 How else can I match ABC (upper and lowercase) to anywhere in my 'description' column? Thanks! Are you saying you put that InStr bit as a criteria under your Description field in the query designer? Try putting Like "*ABC*" as the criteria instead. Alternatively, you could add a computed field to the query InStr([Description, "ABC") and then put >0 as the ...

Unexpected Error- Running Advance Find Query
I am getting a message that says "Unexpected Error An Error has occurred" when I am running an advanced find query on two custom entities. It seems to be when I have certain custom fields included in my view that the query errors out. Any help on this would be greatly appreciated. Thanks so much. Just wanted to add that I seem to get errors when there is a 0.00 amount in these fields... "TJ" wrote: > I am getting a message that says "Unexpected Error An Error has occurred" > when I am running an advanced find query on two custom entities. It se...

Help
I am using Exchange 5.5 SP4 + IIS 4.0. OWA often stops response after installing the Mailbox Manager, says - error 'ASP 0115' Unexpected error /exchange/CHS/logon.asp A trappable error occurred in an external object. The script cannot continue running. When this happens, I can't stop and restart WWW publishing service with Control Panel, the only way is to reboot the whole NT system. Have stopped the mailbox manager service and reapplied SP4, but just useless. Pls help! Thanks! I've never heard of that happening. You might try reinstalling Exchange to reinstall OWA. ...

pass through query
If a combobox is populated by a pass-through query, does it requery every time the form is closed and reopened? Thanks, Sam Yes. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Sam wrote: > If a combobox is populated by a pass-through query, does it requery every > time the form is closed and reopened? > Thanks, > Sam ...

a count field in a query?
Hello, I have a query in which I would like to create a field which increments by 1 for each record selected, so if there are 10 records selected by the query, this column would show numbers 1 to 10. Ideally I would like to have some text in front of each number, say invoice1, invoice2 etc. From a previous posting I realise that this is frowned upon but it would be the simplest solution for my problem! How can I do this? Thanks Geoff On Mon, 03 Dec 2007 08:54:00 +0000, Geoff Cox <<>> wrote: >Hello, > >I have a query in which I would like to create a field which >...

Saving Username and Pass with Web Queries
I am pulling data from a website that requires you to provide a usernam and password everytime you visit the site. Excel has cachin capabilities, but everytime you close excel and try and open up th spreadsheet again, it can't login. What is the fix for this? Thanks, Hend -- Message posted from http://www.ExcelForum.com Bump! --- Message posted from http://www.ExcelForum.com/ ...

Birthday query for many children in one record
I have a database for the church, it has one main flat table only. Each record for the parents have field for child1 name, child1birthday, child2 name, child2birthday, child3 name, child3birthday - up to 5 children. I am having difficulty trying to get a report to list the birthdays of the children like this parent name, child 1 name, child 1 birthday month etc. so you get something like this:- Parent John Smith, child Mary Smith January 3 Parent Fred Jones, child Bert Jones March 4 Parent John Smith, child Jane Smith March 6 Parent Harry Brown, child Jane Brown March 6 Parent Bert Taylor,...

Unresponsive Query Wizard
Hi there, I have an Excel 2003 user who is using a spreadsheet that pulls data from our SQL server. When he opens it and refreshes the data it is fine, it pulls the current data, but when he tries to edit the query, the Query Wizard does not appear, he can see it on the task bar, but when he switches focus using task manager everything is greyed out and nothing works. I have tested the file from my computer and it is fine, which suggests a problem with his machine or installation. Does anyone have any ideas? Cheers, Steve Dooza wrote: > Hi there, > I have an Excel 2003 user who...

autopopulate 02-22-08
I am creating a data entry form to populate a main table. I am trying to get 2 forms in the field to auto populate with info based on the answer to a previous field. Something like this in my activity code field If the entry is 487, then the next field (type of unit) should autopopulate Acre, the next field (cost per unit) should autopopulate 398.99. I made a table just for those fields. I just cannot get it to work right. There are other fields in the form, but those will be entered manually. Any insight. I am just learning access and any help is appreciated. Hi, You can use a Dlooku...

Formula for a fill color help
I can't figure out how to make a formula that will recognize a color a a value. More specifically; If b1 is made to be green (color index 4) would like c1 to insert the letter Y. I am I'm looking for an I statement so I can use it throughout the whole workbook. The formula if I understand it should kind of look like (in C1): =If(b1=colorindex4,"Y","") I'm looking to put a "Y" in c1 if b1 is colored in green. I would really like to also know how to insert a fill color in an formula! Thank you for any of your help and time, Brya -- Bryan J Yo...

Another simple query
Dear all, I have a table that contains first names and last names in different fields. Is there any way to write a query that will give as a result the first name and last name in the same field? I hope this makes sense. Thanks in advance! SELECT [last_name_field] & ", " & [first_name_field] AS whole_name FROM [your_name_table] Change the field and table names to whatever your actual fields and tables are. Cheers, Jason Lepack On Apr 23, 9:47 am, Homer <peter.a.r...@googlemail.com> wrote: > Dear all, > > I have a table that contains first names an...

Query query
I am trying to create a new field in which it shows the sum total of 10 fields (Charge Time, Charge Time 2, Charge Time 3, etc.); what is the easiest way to do this? -- Joe NewFieldName: [Charge Time] + [Charge Time 2] + [Charge Time 3] .... etc -- Good Luck BS"D "joet5402" wrote: > I am trying to create a new field in which it shows the sum total of 10 > fields (Charge Time, Charge Time 2, Charge Time 3, etc.); what is the easiest > way to do this? > -- > Joe I tried this, and it doesn't work. Is there something I'm forgetting? -- Joe ...

enumeration help needed
I want to run through an enumeration in a loop for scanning client sub folders. Base folder is D:\TestStuff\ Subfolders in that are Jones, Smith, Ryan (there could be several more and will not be named this simple) I want to run a loop that goes through those folders one at a time like this: For x = Jones to Ryan .... check for files in each sub folder and do a bunch of processing Next x I thought I could do soemthing with enumerations where the enum would be defined like this: Private enum clientFolders Jones = 1 Smith = 2 Ryan = 3 End Enum T...

can anyone help with this formula
column AP = LINE that is running production some lines have 2 people & some have 1 so for instance i MIGHT HAVE AP6 witch might be 2 OR 4 = hours worked 1 person ON THIS LINE so it will = to 2 or 4 hours witch works Then i have AP13 WITCH MIGHT BE 2 or 4 = hours actually worked but there is 2 people on this so AP13 reads 4 or 8 pending if they worked 2 hours or 4 hours because there is 2 people on this line Now in column AS6:AS37 I PUT IN CLOCK# FOR indirect labour say if 2 clock# entered i want to calculate AP column actual hours worked times AS column indirect labour at tim...

Help! Sharing Calendars
My boss and I both use Outlook 2000. She recently got a handheld computer, but does not have a USB connection on her PC. She wants me to access her calendar through network neighborhood and synchronize. How do I do this? ...

Excel help #8
Hi Please can someone help with this Excel error type message, using Windows 7 & Office 2000. Many thanks in advance. Regards, Problem Event Name: APPCRASH Application Name: EXCEL.EXE Application Version: 9.0.0.2719 Application Timestamp: 36f43422 Fault Module Name: EXCEL.EXE Fault Module Version: 9.0.0.2719 Fault Module Timestamp: 36f43422 Exception Code: c0000005 Exception Offset: 0004e154 OS Version: 6.1.7601.2.1.0.256.48 Locale ID: 2057 Additional Information 1: 9816 Additional Information 2: 981626252e0734cfbb061d9ef2627bd4 Additional Information 3: 35...

Formula needed 01-22-10
Hi I need a formula that will look in one column range for a certain value and for another value in another column range and when they are both found in the same row, will count the number of occurances. Help!!!! Krissy wrote: > Hi > I need a formula that will look in one column range for a certain value and > for another value in another column range and when they are both found in the > same row, will count the number of occurances. Help!!!! http://www.contextures.com/xlFunctions01.html#SumProduct Omit the "values to be summed". =SUMPRODUCT(--(A2...

group by query trouble
I'm trying to run a query that counts the number of people with hemoglobin of type SS, type SC, and then all others. There are about 12 different kinds of types. Basically I want a count for SS, a count for SC, and then a count that totals all the others into one count. Hopefully that makes sense. I'm using group by for the SS and SC which works great, but I'm not sure how to tell it to add up the others. I'm not a big fan of nested IIf statements, but this should work after you put in the proper field and table names: SELECT IIf([Hemoglobin]="SC","SC&...

To Query or not to Query??
Hello all - I'm a newbe to Access but have made great progress. I'm using Acess 2003. The db is up and running prefectly. Now I need to tackle the reporting. I have seen posts about reports and queries and am a little confused. Do I need to create a query to run my reports off of? I have a tabbed subform in the main form. There are seven tabs breaking up all the services we provide. Like "Promo Items", "Leads", "Client Printed Material","Internal Print Material" and so on. The main form has the User, Branch and Marketing Rep. I need to...