Repost of Checkbox Help

  • Thread starter Thread starter ChrisBat
  • Start date Start date
C

ChrisBat

Hi,

Here's the scenario:

I have a form that has a checkbox (Group Notified).
When I check this box, I want three things to happen:
(1) My RunEmail macro to run,
(2) GroupNotified Date textbox to populate with the Date
the checkbox was clicked, and
(3) GroupNotified Time textbox to populate with the Time
the checkbox was clicked.
If the Checkbox is not clicked, or is removed, I want the
Date/Time to remain/become blank and the email NOT to run.

Right now, my RunEmail code works fine by itself, but the
Call statement doesn't work and I keep getting
funny error messages (i.e. Error 91, Set Statement
Required, etc...)...

Any suggestions???
Thank you very much.......
Chris
 
Not sure which part of your code is causing the error. Sounds like the
email part works, so I will address the other issues.

In the BeforeUpdate event of your form put something like...

--------------------------------------------------------
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
If [GroupNotified]=True Then
[GroupNotifiedDate] = Date()
[GroupNotifiedTime] = Time()

Else
[GroupNotifiedDate] = ""
[GroupNotifiedTime] = ""

End If

End Sub
--------------------------------------------------------


RickB



Hi,

Here's the scenario:

I have a form that has a checkbox (Group Notified).
When I check this box, I want three things to happen:
(1) My RunEmail macro to run,
(2) GroupNotified Date textbox to populate with the Date
the checkbox was clicked, and
(3) GroupNotified Time textbox to populate with the Time
the checkbox was clicked.
If the Checkbox is not clicked, or is removed, I want the
Date/Time to remain/become blank and the email NOT to run.

Right now, my RunEmail code works fine by itself, but the
Call statement doesn't work and I keep getting
funny error messages (i.e. Error 91, Set Statement
Required, etc...)...

Any suggestions???
Thank you very much.......
Chris
 
Any suggestions???

I'd suggest that you post the code (or the macro steps) that you are
using. Clearly there is something wrong with the code, but since we
cannot see it, it's more than a bit difficult to figure out what!
 
Actually, the reply from Rick B answered the question - I
didn't know about the If Me.Dirty function, and the rest
of his reply was the same as my code - the Dirty function
works.
(Anybody know if there is a Me.Spank function? :-)....)
Thanks again,
Chris
 
Back
Top