My First Post

Steven Pyrah

New member
Local time
Today, 16:51
Joined
Jan 11, 2003
Messages
7
Hello all

I have been using this site for a couple of weeks now creating a database from scratch, all with your help as I have never touched Access before.

So Firstly.....Thank You!!

Now to my question

I want a field on a form to time stamp when another field on the same form equals something.

ie when the user selects "Record Closed" from a combo box I want a field to be time stamped with the closed time.
The combo box in question has 3 values "Record Open" (default Value), "Record Linked" and "Record Closed". I only want to time stamp a field when "Record Closed" is selected.

I have played around with this but I'm not getting very far.

Please can someone tell me how to do this.

Thanks
 
Last edited:
On your form right click on the Combo Box.Click on the properties
Click on the Event Tab. Go to where it says "On Change" click the "..." to build an expression in VBA. You do not want the "builder" just open a new event procedure in VBA. Access will fill in the Heading and ending like this
Private Sub CoboBoxName_Change()
End Sub
Type the folowing code in th middle:
If Me.ComboBoxName.Text ="Record Closed"
Then
Me.DateFieldName.Value = CStr(Now)
Else
Me.DateFieldName.Value = ""
End If
 
That works great.

Thank you
 

Users who are viewing this thread

Back
Top Bottom