validate data entries on forms

D

Duckula

I have a database that is updated by HUMANS unfortunately.
There are forms set up to minimise data input, however, there is data entries.
I use the standard navigation buttons to move from one record to another. I
need some code that will check the data entered before moving onto the next
record.
If the information is incorrect stop there and notify the user that what
he/she has entered is WRONG, and needs to correct this information.

Please could someone help many thanks
 
B

Brendan Reynolds

Private Function InformationIsCorrect() As Boolean
'Your code to verify your information here.
End Function

Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim strInformativeMessage As String

Cancel = Not InformationIsCorrect()
If Cancel Then
strInformativeMessage = "Your informative message goes here"
MsgBox strInformativeMessage
End If

End Sub

OK, so I'm being a bit flippant, but hopefully you'll understand - we can't
tell you how to determine if the information is correct, because we don't
know what the 'rules' are - the requirements of your particular application.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
D

Duckula

Thanks Brendan for your time, this was very useful, just what was needed for
HUMAN CHIMPS.
Again thanks for your time.
 
Top