Parameter query doesn't work with my format

  • Thread starter Thread starter dlel
  • Start date Start date
D

dlel

Is it true that a parameter query won't work for an
autonumber field that has the \40000 format designated in
design view? I'm using the \40000 because I want all of my
lab codes to begin with 40000. Any way to either run a
parameter query with this format, or to set up my #format
using a different method? Thanks in advance for your help!
 
The Format does not change the value of the number stored. It just changes
how it is displayed. The value that goes into the parameter query must be
the raw number. Here's a short-term fix you might try: Subtract 40000
from the parameter:

WHERE IDField = [Enter Number] - 40000

that should give the actual number.

However, I feel duty-bound to say that using an autonumber in this way is
going to bring you nothing but problems. What happens when you go beyond
40000? Don't say it won't happen. I've seen autonumber jump by that much.

Autonumbers should never be seen by the user and should carry no user
information. They are for relating tables. Period. Stick around here long
enough and you'll hear this over and over.

A better approach would be to create your own field that you can increment
programmatically yourself. On my website (see sig below) is a small sample
database called "AutonumberProblem" which illustrates how.
 
Back
Top