Combo Boxes in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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�
 
Experiment with below proposal.
Me.Text1 = IIf(Nz(Combo1) = "", "", Now)

Pls repost if this doesn't cover your wishes ...

Krgrds,
Perry
 
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.
--
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”?

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]
 
Back
Top