Error handling.
Seeing as how the IsDate will fail if no entry is there, we could just use
the IsDate ..
If IsDate(TextBox4.Value) Then
'your code here..
End If
HTH
--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)
To email, remove the NO SPAM. Please keep correspondence to the board, as
to benefit others.
"Bob Phillips" wrote in message
...
Francis,
Test the values in the userform.
You can test the textbox date with something like
fError = False
With Textbox4
If .Text < "" Then
If IsDate(.Text) Then
fError = True
End If
End If
If fError Then
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End If
End With
You could add that code to the OK/submit button.
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Francis Brown" wrote in message
...
I would like some general advice on error handling please.
In my code once a user has filed out some values on a form the system
tests for a multiuser workbook being open. Only when it gets the book as
read
write will it update the workbook then save it.
Could you give me some advice on where to go with the problem of errors
ocuring in the update. e.g. if the user leaves a the date textbox blank
or
types text then a error 13 mismatch occurs and the program stops with the
multiuser workbook open.
I would like to avoid this for two reasons.
1. as its password protected i dont want the users in it.Just the form to
update it.
2. if it crashes and a user leaves it open then it will prevent other
users
being able to update the data.
any advice on how to make sure everything completes between opening and
closeing the workbook would help.
--
Regards and Thanks for any assistance.
Francis Brown.
|