Searching for an autonumber

Gkirkup

Registered User.
Local time
Today, 10:20
Joined
Mar 6, 2007
Messages
628
I have a large inventory table where every item has a stock number, which is an autonumber.
I want to search for the item by stock number and have a number field where the stock number is entered, and that displays a subform with details of that stock item.
However it does not work! I get a data type mismatch! How do I search for an autonumber?

Robert
 
My psychic abilities are lacking. Any chance you can share some code or your database?
 
Like MajP, I think I left my crystal ball in my other pants. What doesn't work? Finding the MAIN record where that number is used, or finding the records in the SUBFORM where the details are kept?
 
As others have indicated - not much info to go on and hard to guess/divine what you are asking.

Here is an example from my test data where AnimlId is an autonumber.

Code:
SELECT AnimalCapture.CaptureDate, AnimalCapture.AnimalId
FROM AnimalCapture
WHERE (((AnimalCapture.AnimalId) Between 4 And 8));
 
Guessing it has something to do with your search code or query syntax and using quotes or not
 
I left my crystal ball in my other pants.
My pants don't have pockets. It's a male chauvinist plot to keep women downtrodden:)

Searching for an autonumber is the same as searching for any other field. As the others have mentioned, you have to be cognizant of the data types because strings need to be delimeted with single or double quotes, dates by the pound sign ##, and numeric data types are not delimited.
 

Users who are viewing this thread

Back
Top Bottom