how to use a combo box for timestamp

T

Terrence Carroll

I need to use a combo box for a timestamp such that when the "resolved" combo
box is checked the resolution date field is populated with the current time
and date. If the user inadvertantely checks the combo box to date stamp the
resolution date field I want them to have the ability to uncheck the combo
box and return the resolution date to a blank "" status.
 
M

Marshall Barton

Terrence said:
I need to use a combo box for a timestamp such that when the "resolved" combo
box is checked the resolution date field is populated with the current time
and date. If the user inadvertantely checks the combo box to date stamp the
resolution date field I want them to have the ability to uncheck the combo
box and return the resolution date to a blank "" status.


Combo boxes are not "checked", their value is selected or
entered.

You can use the combo box's AfterUpdate event it set/clear
the date field as long as you know the selected value.
Let's say that the combo box's value is either "resolved" or
anything else for not resolved. Then the AfterUpdate event
procedure might look like:

If Me.cboResolved = "resolved" Then
Me.[resolution date] = Date
Else
Me.[resolution date] = Null
End If
 
B

Barry A&P

Or if you are like me and are incorrectly calling a check box a combo box

you could change marshall's suggestion to

If Me.ChkBoxResolved = True Then
Me.[resolution date] = Date
Else
Me.[resolution date] = Null
End If

this will also clear the resolution date also if the check box is unchecked

Just my two cents
Barry

Marshall Barton said:
Terrence said:
I need to use a combo box for a timestamp such that when the "resolved" combo
box is checked the resolution date field is populated with the current time
and date. If the user inadvertantely checks the combo box to date stamp the
resolution date field I want them to have the ability to uncheck the combo
box and return the resolution date to a blank "" status.


Combo boxes are not "checked", their value is selected or
entered.

You can use the combo box's AfterUpdate event it set/clear
the date field as long as you know the selected value.
Let's say that the combo box's value is either "resolved" or
anything else for not resolved. Then the AfterUpdate event
procedure might look like:

If Me.cboResolved = "resolved" Then
Me.[resolution date] = Date
Else
Me.[resolution date] = Null
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top