Determine Null Fields Tabbed Control

hi there

Registered User.
Local time
, 22:25
Joined
Sep 5, 2002
Messages
171
hi all,

i have a single table datasource that feeds a bound form with a tabbed control on it to separate the data into a meaningful way for the user. basically the user only has to populate the 2nd tab if the answers for 2 controls on the first tab are "yes". there are more than 2 controls on the first tab, but only 2 are important for determining if the 2nd tab needs data. i'm trying to write a validation function to make sure that if the answers for the 2 controls on the first tab are yes that if will not commit the record unless the information in 4 controls on the 2nd tab are populated.

database info:

2 controls on first tab are "yes/no" fields
4 controls on 2nd tab are "memo" fields

for simplicity i created the following test function which i call from a save command button on the data entry form.


**************************************************
Public Function Section2Validation(YN1 As Integer, YN2 As Integer, CA As String) As Integer


'Function Returns 1 if Section II is required and not populated

If (YN1 = 0 Or YN2 = 0) Then
If IsNull(CA) Then 'also tried Nz( ) with no success
Section2Validation = 1
End If
Else
Section2Validation = 0
End If

End Function

***********************************************

however i'm getting an invalid use of null error.

could someone please help me out with this.

many thanks for any help or ideas.
 
Strings are not allowed to be "Null" but Variants are.
 
hi rural,

thanks a bunch. as soon as i changed to variant everything worked.

many thanks.
 

Users who are viewing this thread

Back
Top Bottom