Tabbed form Validation

Tupacmoche

Registered User.
Local time
Today, 14:35
Joined
Apr 28, 2008
Messages
291
Hi Form Masters,

I have a form that must be filled in under certain conditions. When the user selects the print button I have code that checks if it is required as follows:

If Nz(Me.txtAmtCash.Value) >= 50000 Or Nz(Me.PledgeAmount.Value) >= 50000 Or Nz(Me.SPH_StewardShip.Value) = 1 Then
MsgBox ("You must fill out a StewardShip form to continue...")
Else
End If

What, I need help on is determining one that the page on a tabbed form was filled in completely it has eight fields on it and then exist the code to print with the message 'Please fill out form'. Any assistance would be appreciated.
 
A tabbed form is no different to a single form - the Tabs simply extend the available form space. So simply check your 8 fields in the print command button code.

What part of this are you struggling with / what have you tried that didn't work?
 
What, I need is confirmation that the form was filled out when required. Something like a Boolean = 1 or yes the form has been filled out and so my validation code allows the user to print.
 
Assuming you have a button to print the report simply put something like this in to check your fields;

Code:
Dim bCheck as Boolean

bCheck = True

If Me.txtField1 <> Yourcriteria Then bCheck = false
If Me.txtField2 <> YourField2Criteria Then  bCheck = false
etc etc.


If Not bCheck Then 
    MsgBox "Form incomplete please check!"
    Exit Sub     ' Something wasn't right so exit without printing
End iF
' Otherwise it was all good so print
Do.cmd openreport "YourReport"
 

Users who are viewing this thread

Back
Top Bottom