By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,480 Members | 3,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,480 IT Pros & Developers. It's quick & easy.

autofill current date in subform field

P: n/a
I have a search form with a query-linked subform.

One of the fields in the subform are date fields.

Is there a way to autopopulate the DateFilled field when the person
enters the field? I need this to be code which is entered into the
form, rather than as a property of the field in the table because
there is other data which is entered before. This data is entered in
at a later date.

example

OrderNum ProductName Qty DateOrdered DateFilled
---------------------------------------------------------------------------------
439 Round To-it 3 2/2/2001 N/A
440 Round To-it 2 2/12/2001 2/2/2002
441 Round To-it 4 2/18/2001 =Date()

where record 441 is the one being entered in the subform.
Apr 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
in the form, try adding the following code to the date control's Enter event
procedure, as

If IsNull(Me!DateFieldName) Then Me!DateFieldName = Date

the above must go all on one line in the VBA window, or it won't run.

hth
"Stephen D Cook" <st******@comcast.net> wrote in message
news:m4********************************@4ax.com...
I have a search form with a query-linked subform.

One of the fields in the subform are date fields.

Is there a way to autopopulate the DateFilled field when the person
enters the field? I need this to be code which is entered into the
form, rather than as a property of the field in the table because
there is other data which is entered before. This data is entered in
at a later date.

example

OrderNum ProductName Qty DateOrdered DateFilled
-------------------------------------------------------------------------- ------- 439 Round To-it 3 2/2/2001 N/A
440 Round To-it 2 2/12/2001 2/2/2002
441 Round To-it 4 2/18/2001 =Date()

where record 441 is the one being entered in the subform.

Apr 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.