Error

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

Guest

I have a form with two textboxes: DD and dueDate. From the AfterUpdate event
of DD, 9 months is added to the dueDate and a function is called which tests
if a weekday falls on a weekend or Holiday. If true, the dueDate moves up to
the next business day. Works nicely. However, I need some error handling,
which I don't know how to do. For example, if someone entes 3/23/2006 in DD,
the dueDate correctly populates as 12/26/2006. Then, if 3/23/2006 is deleted
in DD before 12/26/03 is deleted in dueDate, I get an Type Mismatch error
'13'. I want to prevent the user from deleting DD before dueDate.
Thanks,
 
I have a form with two textboxes: DD and dueDate. From the AfterUpdate event
of DD, 9 months is added to the dueDate and a function is called which tests
if a weekday falls on a weekend or Holiday. If true, the dueDate moves up to
the next business day. Works nicely. However, I need some error handling,
which I don't know how to do. For example, if someone entes 3/23/2006 in DD,
the dueDate correctly populates as 12/26/2006. Then, if 3/23/2006 is deleted
in DD before 12/26/03 is deleted in dueDate, I get an Type Mismatch error
'13'. I want to prevent the user from deleting DD before dueDate.
Thanks,

Add code to the BeforeUpdate event of DD to test for Len(DD & "") =0 , then look
at dueDate and if not deleted either delete it yourself or warn the user and set
Cancel = True and Me.DD.UnDo

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
RuralGuy,
Thanks very much!
--
Howard


RuralGuy said:
Add code to the BeforeUpdate event of DD to test for Len(DD & "") =0 , then look
at dueDate and if not deleted either delete it yourself or warn the user and set
Cancel = True and Me.DD.UnDo

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
RuralGuy,
Thanks very much!

You're very welcome. Glad to assist.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Back
Top