Not an autonumber

M

mmp

Hi -

I want to create an automatic number for each new record that is entered. I
have tried the following in the default value field of the ProductID. What
am I doing wrong?

=DMax("[ProductID]",[Name of Form])+1
 
K

Ken Snell \(MVP\)

You need this expression for the Default Value (replace PutNameOfTableHere
with the actual name of the table):

=DMax("ProductID", "PutNameOfTableHere") + 1
 
M

mmp

I get an "unknown function" or default value error when i go to save. the
name of my table is "Product"
This is the first record in my table.
I wrote this under default value -

=DMax("ProductID", "PutNameOfTableHere") + 1

Ken Snell (MVP) said:
You need this expression for the Default Value (replace PutNameOfTableHere
with the actual name of the table):

=DMax("ProductID", "PutNameOfTableHere") + 1

--

Ken Snell
<MS ACCESS MVP>



mmp said:
Hi -

I want to create an automatic number for each new record that is entered.
I
have tried the following in the default value field of the ProductID.
What
am I doing wrong?

=DMax("[ProductID]",[Name of Form])+1
 
M

mmp

I figured out what i was doing wrong.

Thanks!!
You need this expression for the Default Value (replace PutNameOfTableHere
with the actual name of the table):

=DMax("ProductID", "PutNameOfTableHere") + 1

--

Ken Snell
<MS ACCESS MVP>



mmp said:
Hi -

I want to create an automatic number for each new record that is entered.
I
have tried the following in the default value field of the ProductID.
What
am I doing wrong?

=DMax("[ProductID]",[Name of Form])+1
 
J

John W. Vinson

I get an "unknown function" or default value error when i go to save. the
name of my table is "Product"
This is the first record in my table.
I wrote this under default value -

=DMax("ProductID", "PutNameOfTableHere") + 1

Ken did not know the name of your table. He gave you a suggestion *that you
could adapt*. You took his helpful suggestion literally.

Please think rather than just copying blindly.
 
M

mmp

Actually, I was entering it in the table as opposed to the form - which after
googling appears to be a common issue for beginners.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top