2 step query not working

dab1477

Board Regular
Joined
Jul 30, 2002
Messages
65
Thanks in advance for the assist.
I have a want to pull the following information from a data table.
Part number and Machine number.

I created an inital query for Part Number. I enter the part number using [Enter Part Number] in my criteria for Part Number and the query correctly returns all records for that part number. This part works as designed.

My 2nd step is to create a 2nd query that will look at the 1st query above and allow me to use [Enter Machine Number] in the Machine Number query. This field is a text field in the data table because I use an alpha-numeric designation for the work station (i.e. R1B which stands for Robot 1, side b). When I enter R1B into my parameter box - [Enter Machine], I get NO results, but I know from looking at my data table that there are 2 records with R1B and the desired part number.

What am I doing wrong in the 2nd query? Can I do both requests from a single query? I have been unsuccessful entering both [Enter Part Number] and [Enter Machine] within the same query. I get NO records, but I know records exist within the data table.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
You should be able to add multiple parameters right into a single query without any issues.

It sounds like you may be having trouble with the Machine parameter. Try creating a parameter with JUST that parameter by itself and see if it works. If it doesn't, check to make sure that you entered a valid matching option. If it is not working, check for things like trailing spaces or something of that nature in your data.
 
Upvote 0
You should be able to add multiple parameters right into a single query without any issues.

It sounds like you may be having trouble with the Machine parameter. Try creating a parameter with JUST that parameter by itself and see if it works. If it doesn't, check to make sure that you entered a valid matching option. If it is not working, check for things like trailing spaces or something of that nature in your data.
Thanks Joe4,
None of the options worked. I have verified that my parameter in query 2 was operable. It is not. When I only enter R1B into Machine as parameter, it returns nothing. I verifed that there were NO spaces in the listing of machines.
I'm not sure what you mean by "valid matching option". Please elaborate. Thank you.
 
Upvote 0
Pleased show us the queries you are using.
 
Upvote 0
When I only enter R1B into Machine as parameter, it returns nothing.
If you created query with just one paramter, on this "machine" field, and when you test it returns nothing, it most likely means one of a few things:
1. you placed the parameter on the wrong field
2. you are mis-typing the parameter value your are searching for
3. the values in that "machine" field are not what you think they are (is that really a "one" or a "lower case L"?)

Instead of having a parameter query, what if you put the criteria in that query directly in place of that query, i.e. put "R1B" in the crtieria line of that field. If that returns nothing, then regardless of what you think, there are no records in that table with a value of exactly "R1B" in that machine field.

Try creating a select query with no parameters with a calculated field that checks the length of your machine field, i.e.
MyLen: Len([Machine])
and sort on the Machine field.

Run that query and go down to the "R1B" entry. Does it show a length of 3, or something more? If something more, you have some other special unseen characters in your entries.

As Jackd mentioned, if you cannot figure this out, it would be helpful if you could post your query and some sample data.
 
Upvote 0

Forum statistics

Threads
1,215,543
Messages
6,125,429
Members
449,223
Latest member
Narrian

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top