Auto-Fill Date Field

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
 
M

Marshall Barton

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".
 
P

PC Datasheet

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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top