Default Value in form

  • Thread starter Thread starter Madhup Thakur
  • Start date Start date
M

Madhup Thakur

Al Camp,

You Enunciated my problem better than me. The solution is returning the
error that "You may have entered a comma without a preceding value /
identifier". The table name in my database is "Sickdata" and the field is
"SrNo"
I have no problem in getting duplicates in the field. Secondly instead of
the Maximum value("DMax" function) I want the dafault value to increase by
one from the previous row.

Thank you very much for helping out.

Madhup
AlCamp said:
Madhup,
I think you want to use the DefaultValue for a field to increment that
field.
(ex. field name [MyField]... use your own)
Try a DefaultValue for MyField of...
= DMax("[MyField]","tblMyTable") + 1
Since this is a DefaultValue, it will be editable.
Better make sure the field is defined in your table as NoDupes if you're
using it as a key field.
hth
Al Camp

Madhup Thakur said:
Access 2000 / Win 98

I wish to increment by "1" a default value in a form in a column. But I do
not wish it to be an Autonumber since I need it to be "Editable" on the
fly.
Is there a way? Thank to anyone who would care to respond.

M. Thakur

----- Original Message -----
From: "AlCamp" <[email protected]>
Newsgroups: microsoft.public.access.forms
Sent: Monday, January 03, 2005 5:41 AM
Subject: Re: Default Value in form

Madhup,
I think you want to use the DefaultValue for a field to increment that
field.
(ex. field name [MyField]... use your own)
Try a DefaultValue for MyField of...
= DMax("[MyField]","tblMyTable") + 1
Since this is a DefaultValue, it will be editable.
Better make sure the field is defined in your table as NoDupes if you're
using it as a key field.
hth
Al Camp

Madhup Thakur said:
Access 2000 / Win 98

I wish to increment by "1" a default value in a form in a column. But I do
not wish it to be an Autonumber since I need it to be "Editable" on the
fly.
Is there a way? Thank to anyone who would care to respond.

M. Thakur
 
hi,
If you do have duplicates in your field then you do have a
problem. you could use last instead of max but this will
not garrentee that the last record is the previous record
because of the way the data sometimes gets put into the
table. The no dups is the best way to do this.
I too detest autonumber so i use my own much the same way
listed below but unless the field is set to no dups,
incrementing by 1 will always be a problem.
-----Original Message-----
Al Camp,

You Enunciated my problem better than me. The solution is returning the
error that "You may have entered a comma without a preceding value /
identifier". The table name in my database is "Sickdata" and the field is
"SrNo"
I have no problem in getting duplicates in the field. Secondly instead of
the Maximum value("DMax" function) I want the dafault value to increase by
one from the previous row.

Thank you very much for helping out.

Madhup
AlCamp said:
Madhup,
I think you want to use the DefaultValue for a field to increment that
field.
(ex. field name [MyField]... use your own)
Try a DefaultValue for MyField of...
= DMax("[MyField]","tblMyTable") + 1
Since this is a DefaultValue, it will be editable.
Better make sure the field is defined in your table
as NoDupes if
you're
using it as a key field.
hth
Al Camp
in a column. But I
do
----- Original Message -----
From: "AlCamp" <[email protected]>
Newsgroups: microsoft.public.access.forms
Sent: Monday, January 03, 2005 5:41 AM
Subject: Re: Default Value in form

Madhup,
I think you want to use the DefaultValue for a field to increment that
field.
(ex. field name [MyField]... use your own)
Try a DefaultValue for MyField of...
= DMax("[MyField]","tblMyTable") + 1
Since this is a DefaultValue, it will be editable.
Better make sure the field is defined in your table
as NoDupes if
you're
using it as a key field.
hth
Al Camp
in a column. But I
do

.
 
Back
Top