DMax question

S

Scuda

Hello, all. I am trying to have a specific number increment by one every time
a Add New Record is clicked on my form (single form).

On the form button I have: DMax("[SENE CASE #]","[SENE Sar Log]")+1 in
the default value (I have 13 records in there already)

My text box is named SENE CASE # and my table is named SENE Sar Log. When I
click Add New Record I am just getting #error.

Can anyone tell me what I am doing wrong?

Thanks!
 
A

Al Campagna

Scuda,
I'd avoid the # in field names. This is a symbol used in DATE values, and could be
causing the problem.
Try SeneCaseNo instead.

Remove brackets from the table name.

You wrote...
My text box is named SENE CASE # and my table is named SENE Sar Log.
**SeneCaseNo should be a Numeric field.**

Also, avoid spaces in field names... it makes coding a lot easier...

Try...
= DMax("[SeneCaseNo]","SENESarLog") + 1

--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Scuda said:
Hello, all. I am trying to have a specific number increment by one every time
a Add New Record is clicked on my form (single form).

On the form button I have: DMax("[SENE CASE #]","[SENE Sar Log]")+1 in
the default value (I have 13 records in there already)

My text box is named SENE CASE # and my table is named SENE Sar Log. When I
click Add New Record I am just getting #error.

Can anyone tell me what I am doing wrong?

Thanks!
 
S

Scuda

Thanks a million Al, I had read that if the table had spaces you should use
the brackets. I have since changed my naming practices.

Thanks again!

Al Campagna said:
Scuda,
I'd avoid the # in field names. This is a symbol used in DATE values, and could be
causing the problem.
Try SeneCaseNo instead.

Remove brackets from the table name.

You wrote...
My text box is named SENE CASE # and my table is named SENE Sar Log.
**SeneCaseNo should be a Numeric field.**

Also, avoid spaces in field names... it makes coding a lot easier...

Try...
= DMax("[SeneCaseNo]","SENESarLog") + 1

--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Scuda said:
Hello, all. I am trying to have a specific number increment by one every time
a Add New Record is clicked on my form (single form).

On the form button I have: DMax("[SENE CASE #]","[SENE Sar Log]")+1 in
the default value (I have 13 records in there already)

My text box is named SENE CASE # and my table is named SENE Sar Log. When I
click Add New Record I am just getting #error.

Can anyone tell me what I am doing wrong?

Thanks!
 
S

Scuda

Ok, I have another question that is very related so I didn't think a new
thread was warranted, if I am wrong, I apologize.

What if I want to have a text bos that just DISPLAYS the Next Number. In
other words, if I click on Add New Record, and my SENE CASENO changes to say
15, which it is doing, I would like to have another box that says Mext Number
: 16.

What is the easiest way to accomplish that.

Thanks!

Scuda said:
Thanks a million Al, I had read that if the table had spaces you should use
the brackets. I have since changed my naming practices.

Thanks again!

Al Campagna said:
Scuda,
I'd avoid the # in field names. This is a symbol used in DATE values, and could be
causing the problem.
Try SeneCaseNo instead.

Remove brackets from the table name.

You wrote...
My text box is named SENE CASE # and my table is named SENE Sar Log.
**SeneCaseNo should be a Numeric field.**

Also, avoid spaces in field names... it makes coding a lot easier...

Try...
= DMax("[SeneCaseNo]","SENESarLog") + 1

--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Scuda said:
Hello, all. I am trying to have a specific number increment by one every time
a Add New Record is clicked on my form (single form).

On the form button I have: DMax("[SENE CASE #]","[SENE Sar Log]")+1 in
the default value (I have 13 records in there already)

My text box is named SENE CASE # and my table is named SENE Sar Log. When I
click Add New Record I am just getting #error.

Can anyone tell me what I am doing wrong?

Thanks!
 

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