Auto Populate a form field

Jwy

Registered User.
Local time
Today, 05:11
Joined
Sep 19, 2005
Messages
10
I have a form with fields "Assigned To" and "Assigned Date". When "Assigned To" receives a value, i.e. Not=Null, I want to auto-populate the "Assigned Date" field with the current date and time. How can I do this? Any help is appreciated.
 
In the AfterUpdate event of AssignedTo:

Code:
If IsNull(Me.AssignedTo) or Me.AssignedTo <> "" Then
    Me.AssignedDate = Now()
End If
 
Thanks, Pat, you've been a big help.
 
One more thing. Now I have a ProjectStatus combo box with several entries (UnAssigned, Assigned, InProcess, etc.) that I want to set to "Assigned" when I assign the project. Using your code above, I added:
Me.ProjectStatus = "Assigned"
...this does not work. Do I need to use the zero relative index to the entry in the combo box to set it correctly? Just a guess on my part. If you would be so kind as to show me the code required, I would appreciate it.
 
Are you really storing the text status or are you storing a numeric value? The combo may show the text value but it is likely that it is storing the numeric ID. In that case your let statement needs to use the ID of "Assigned" rather than the text.
 

Users who are viewing this thread

Back
Top Bottom