Validating Form Field

  • Thread starter Thread starter SteveR
  • Start date Start date
S

SteveR

I have a form which contains two fields from the same
table. If [reason] = "Contract Work" I want [Customer]
to be Not Null. Should I do this on the form level or
table level? Either way, I can't get it working. Can
someone show me the light?

Thanks for the help!
 
Not so sure what you are trying to accomplish here.. You
can check the contents of a field by adding the following
code to the Forms "On Current" Procedure: -

Dim MaxError as Integer,String1,String2 as String
String1 = "Contract Work"
String2 = Me.Reason
MaxError = strcomp(string1,string2,vbtextcompare)
'Occurs if Reason is "Contract Work"
if maxerror = 0 then msgbox ("Reason is Contract Work")
'Occurs if Reason is not "Contract Work"
if maxerror <> 0 then msgbox ("Reason is not Contract
Work")

HTH


Tony C
 
Back
Top