Display fields if not null

adams.bria

Registered User.
Local time
Yesterday, 19:24
Joined
Apr 28, 2010
Messages
41
I have about 25 fields on a form all locked. If any of the fields are null, I do not want that field to display. I was able to create this on one field by attaching it to the on load event, however, I am not sure how to add the other fields. Thanks!

Code:
Private Sub Form_Load()
If IsNull(Me!Pref_Athl_Assis) Then
Me!Pref_Athl_Assis.Visible = False
Else
End If
End Sub
 
Yes it is.
 
So use:
Code:
Private Sub Form_Load()
    If Len(Me!Pref_Athl_Assis & vbNullString) Then
        Me!Pref_Athl_Assis.Visible = False
    Else
        Me!Pref_Athl_Assis.Visible = True
    End If

    [COLOR=Red]If ...[/COLOR]
End Sub
And just repeat the same code under each block.

Oh, by the way, move the code to the On Current event of the form.
 
I was sure I was getting an error when I tried that...

Works now though!
 
You did move the code to the Form_Current event, rather than the Form_Load event, as vbaInet instructed, didn't you? Not doing so would result in all Records being formatted according to the data in the First Record!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom