Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2007

Tip: Looking for answers? Try searching our database.

Combo Boxes in a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PJ - 30 Jan 2007 20:09 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”?
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]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.