Conditional Fields

blueBeard

Registered User.
Local time
Today, 11:45
Joined
Jun 19, 2002
Messages
20
Is there a way to show a field in a form, only if there is data for that field? For example, if the field is blank, can I omit viewing it in the form???? I know I could use a query to omit that record from the recordset, but I may still want to show that record, but just not that field in the form. Make sense? Please advise. THANKS!!!!
 
On the form's OnCurrent Event try:

If IsNull(Me.FieldName) Then

Me.FieldName.Visible = False

Else

Me.FieldName.Visible = True

End If


Note:

Substitute FieldName with the actual name of your field.

HTH,


Lyn
 
When I try to rename the FieldName in the code provided to me by the previous post, I get an Automation Error. Any ideas? I tried to type in the field name, and also select it from the drop down box. Any help is appreciated!!!
Thanks
 
On the On_Current event,

If IsNull(Me.FieldName) Then
Me.FieldName.Visible = False
Else
Me.FieldName.Visible = True
End If

Note:

Substitute FieldName with the actual name of the control on the form, not the fieldname.
 
Is the CONTROL the same thins as the NAME or CONTROL SOURCE? I used those names to substitute FieldName, but still get the Automation error. Geez, I am realy starting to get frustrated with Access @#!$! But thanks to all the supporters. This is like a "support" group for those with Accessenitus.
 
problem fixed. it was related to my other post, and Pat's suggestion.
 
Fizzio:

Thanks for the clarification.:o


blueBeard:

Good to know that you got it working:) .



Lyn
 

Users who are viewing this thread

Back
Top Bottom