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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Code 3

Status
Not open for further replies.

Lavenderchan

Technical User
Jul 21, 2008
132
US
Hi I was wondering I have a check box that I want to be check if a date is passed a certain amount of days. I have the past due days already in table but I'm not sure how to write the code to get this function to work. Would it be before update or after update? I'm a little confused. Any help would be helpfull.

Thanks,
Keri
 
What do you mean bu isn't working properly? I just check and making your check box enabled = no does not effect the code form working. However, i should of told you to change the lock to yes instead of the enabled to no.
However, neither of these effects the code and how it works


ck1999
 
I meant once i open my form this morning i made the change to the box I don't think that cause it but my code isn't working now and I cannot figure out what went wrong. I have it set on after update on the past due text box and on current for the form. Sorry for the missunderstanding.

Keri
 
Try putting a code break in and see if the code is being triggered.

ck1999
 
I've toggled and look at the code. I believe the code is not being tiggered. How do I correct this?
Thanks,
Keri
 
the event is in the property sheet for on current and after update for the fields. Its still not triggering. I'm confused on why its not.
Thanks,
Keri
 
Private Sub Form_Current()
If Me.Status = ("Active") Then
Me.Is_Past_Due_ = Me.Past_Due < Me.Due_Date
End If
End Sub
Private Sub Past_Due_AfterUpdate()
If Me.Status = ("Active") Then
Me.Is_Past_Due_ = Me.Past_Due < Me.Due_Date
End If
End Sub
 
Does the name for Me.Is_Past_Due have the trailing _?

ck1999
 
The Is Past Due? does have a question mark at the end.
Thanks,
Keri
 
once again, PLEASE read and head some standard naming convention.

Your names -as they are in this snippet- do not appear to follow A N Y standard and can / will cause problems for you and anyone reviewing your code in the future!!!




MichaelRed


 
I removed the if then statement and the code is still not working. I'm going insane. I'm not sure why itsn't working.
Thanks,
keri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top