I have a combo box with the control source named Participant Name. If a
particular name is selected then I want to have the current date
automatically fill into a different text box and keep that date. Then if
that same name is deselected in the combo box then the date disappears in the
text box. How would I code that? Would that code go in combo box "after
update”?
Perry - 30 Jan 2007 20:54 GMT
Experiment with below proposal.
Me.Text1 = IIf(Nz(Combo1) = "", "", Now)
Pls repost if this doesn't cover your wishes ...
Krgrds,
Perry
>I have a combo box with the control source named Participant Name. If a
> particular name is selected then I want to have the current date
[quoted text clipped - 3 lines]
> text box. How would I code that? Would that code go in combo box "after
> update"?
Al Campagna - 30 Jan 2007 21:03 GMT
PJ,
Use the AfterUpdate event of combo...
Private Sub
If Not IsNull([Participant Name]) Then
MyDateField = Date()
Elseif IsNull([Participant Name]) Then
MyDateField = Null
End if
End Sub
This will not Null the MyDateField if you select another value in the combo... only if
you delete the combo value itself.

Signature
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
>I have a combo box with the control source named Participant Name. If a
> particular name is selected then I want to have the current date
> automatically fill into a different text box and keep that date. Then if
> that same name is deselected in the combo box then the date disappears in the
> text box. How would I code that? Would that code go in combo box "after
> update"?
John Vinson - 31 Jan 2007 01:01 GMT
>I have a combo box with the control source named Participant Name. If a
>particular name is selected then I want to have the current date
>automatically fill into a different text box and keep that date. Then if
>that same name is deselected in the combo box then the date disappears in the
>text box. How would I code that? Would that code go in combo box "after
>update?
Do you mean by "a particular name" to say "if the user selects Jane
Doe from the combo, fill in the date field; otherwise blank it out"?
or do you mean for the date to be filled in whatever name is selected?
John W. Vinson[MVP]