Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fields

Status
Not open for further replies.

Ccode

ISP
Mar 26, 2002
3
US
I have a form and i have some fields that should be automatically populated (for example, the data and time the record was created and a unique id).. Is there any way to do this behind the sceens - so the user does not have to input it in?
 
Try the field Default Value
=Date() (System date)
=Now() (System time)
AutoNumber

Chunk22
 
That will work for the datetime fields - but the uniqueid it is not an autoincrement number - it is a combination of things that i need to set..
 
You will have to create code for the OnCurrent event or BeforeInsert event. You can test to see if the UniqueID has a value. If "no", then use code to create / find the UniqueID.

Another approach, if you use a "smart" UniqueID, is to build the the entry after you have enough information. For example, after the customer has been selected, and the date and time is set, you can use the value of these three fields to create the UniqueID.

CustomerCode + yyyymmdd + hhmmss

How to create the UniqueID will be up to you since the post is shy on details.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top