On Click Even with If Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having a little trouble.

Discover Paid (a check box)
Discover Paid Date (a text box)

Discover Paid Control Name = DiscoverPaid
Discover Paid Date Control Name = DiscoverPaidDate

When I click on the check box for Discover's been Paid, it will then put
today's date into the Paid Date box, but only if it is checked, value = Yes.
But when you uncheck it, it clears the text box, so there is only a date when
the check box is checked and always empty when not checked or has been
unchecked.

I'm assuming you put this code in the on click event? I'm having trouble
with the coding too. :)

Thanks for your help!

Curtis
 
I figured it out, woo hoo! I kept trying Yes, No, etc. True/False was the
prob!

If Me.DiscoverPaid = True Then Me.DiscoverPaidDate = Date
If Me.DiscoverPaid = False Then Me.DiscoverPaidDate = Null
 
<< AIR CODE >>
Private Sub DiscoverPaid_Click()

If Me.DiscoverPaid Then
Me.DiscoverPaidDate = Date()
Else
Me.DiscoverPaidDate = Null
End If

End Sub
 

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

Back
Top