Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a field with a checkbox

Status
Not open for further replies.

julz8

Programmer
May 29, 2003
7
0
0
US
Hi. I have a form containing one variable [SHPD] which is set up as a YES/NO type and another variable [DATSHP]which is a date type. Upon clicking the SHPD checkbox on the form, I want the current date to be entered in the DATSHP field. Similarly, when the checkbox is unchecked, I want nothing or all zeros entered in the DATSHP field. Currently, I have the following event procedure set up on the SHPD variable:

Private Sub SHPED_AfterUpdate()
DATSHP = Date
End Sub

How do I go about clearing the date when the box is unchecked? Any help is greatly appreciated.
 
You need to add an 'If statement' some thing like this:

If [shpd] = yes then
DATSHP = Date
else
DATSHP = ""
Endif

Then use a requery command to update the form data. This is just a hint to get you started. You will have to work out coding.
 
all set....thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top