Easy query won't work right!

badangel

Registered User.
Local time
Today, 01:00
Joined
Jan 31, 2003
Messages
26
Hi Everyone, I have another simple problem!

I have a text box that the user inputs a customer id into then when they hit the search button i run a query that should display all of the records for that customer id, however, nothing comes up when i run it!
If its a parameterised query with the little box that comes up and the user enters the number there it displays the details fine but it just won't work this other way! Can anyone tell me what I'm doing wrong?

My query is this:

SELECT Customer.AutoNum, Customer.CompanyName
FROM Customer
WHERE (((Customer.AutoNum)=[Forms]![Form1]![findNum]));

findNum is the textbox that the user inputs the numbr into. I know this is probably simple - Millions of thanks in advance!
 
This has happened to me before when instead of pulling a number say 1, it thought it was pulling a string "1". And that doesn't work so good.

What I've done is setup a combobox that is bound to the customer id but only shows the customer's name. That way people don't need to remember id #'s. That's always worked for me in the past.
 
Thanks for the reply Rob. I could make the text box into a drop down menu with the company ids but i've alread got a drop down menu with the company names in it which works fine and I wanted to have a range of search options, which was why i was trying to do it like this as well.

Anyone got any more ideas on why this query doesn't work?? Cheers in advance!
 

Users who are viewing this thread

Back
Top Bottom