Date in a form (1 Viewer)

$lim

Registered User.
Local time
Yesterday, 22:17
Joined
Dec 14, 2004
Messages
21
I am currently working with a form that automatically puts today's date in the date field, which can be change if desired. However, I want to make it so user have to enter the date on there own, and after they create a record and start a new one I need it to retain the date that they entered. I am pretty new at this so any help would be appreciated.
 

KenHigg

Registered User
Local time
Yesterday, 22:17
Joined
Jun 9, 2004
Messages
13,327
Are you using an autonumber fld as the primary key?

kh
 

$lim

Registered User.
Local time
Yesterday, 22:17
Joined
Dec 14, 2004
Messages
21
Yes, the primary key is the number of the record
 

KenHigg

Registered User
Local time
Yesterday, 22:17
Joined
Jun 9, 2004
Messages
13,327
Well, I can think of two ways right off the bat to do this. The first is to set the flds default value to use a dlookup() where it gets the date from the record with the largest primary key value. I would only use this where the form didn't have to keep hitting a table with a lot of records (I would consider 5k to be a lot.)

The other way would be to create a hidden fld on the form and use it as the default value, updating it's in the afterupdate event of the date fld you use to actually store the value.

Make sense?

kh
 

Users who are viewing this thread

Top Bottom