Auto-Fill Date Field

  • Thread starter Thread starter Kirstie Adam
  • Start date Start date
K

Kirstie Adam

All,

I have a field on my form called [EventDate] This is a simple date format
field.At the moment the user always has to type in the date manually. I also
have a field called [EventType], which is a combo-box list.
However, i would like it if i could say that when a certain option from the
combo-box is picked (e.g. Mail Shot - Newsletter) that the [EventDate] field
would automatically fill in with the date that the record was added.

I would appreciate some help with this one.

If i am not being clear enough, let me know.


Kirstie
 
Kirstie Adam said:
I have a field on my form called [EventDate] This is a simple date format
field.At the moment the user always has to type in the date manually. I also
have a field called [EventType], which is a combo-box list.
However, i would like it if i could say that when a certain option from the
combo-box is picked (e.g. Mail Shot - Newsletter) that the [EventDate] field
would automatically fill in with the date that the record was added.


Use the xombo box's After Update event procedure to set the
eventdate's text box. The code might look something like:

If Me.Combo = "Mail Shot" Then
Me.EventDate = Date()
End If

If the combo box's bound column (not necessarily the value
you see) is a code number instead of the actual text, then
use that value instead of "Mail Shot".
 
If by "the date that the record was added" you mean today's date, put the
following code in the AfterUpdate event of the combobox:

Me!EventDate = Date()
 
Back
Top