Hide a field

Eddie Mason

Registered User.
Local time
Today, 14:19
Joined
Jan 31, 2003
Messages
142
Hi All,

Is it possible to hide a field based on a condition, on a datasheet form, using the load event?

Regards

Eddie
 
Eddie Mason said:
Hi All,

Is it possible to hide a field based on a condition, on a datasheet form, using the load event?

Regards

Eddie

Yes :D
 
Thanks for letting me know that it's possible to hide a field based on a condition, on a datasheet form, using the load event?

How do I hide a field based on a condition, on a datasheet form, using the load event?

Regards


Regards
 
Eddie Mason said:
Thanks for letting me know that it's possible to hide a field based on a condition, on a datasheet form, using the load event?

How do I hide a field based on a condition, on a datasheet form, using the load event?

Regards


Regards

Use the code builder behind the 'on load' event of your form.

Use an if/else loop to set the visable = True or false according to criteria

I.e

Code:
Private Sub Hidemydoobry
If (some criteria = something) Then (Somethin) Visable = True
Else
(somethin) Visable = False
End If
End Sub

You could do well to have some error traping routine in here as well.

i.e
Code:
Private Sub HideMyDoobry
On Error GoTo Err_HideMyDoobry

[INDENT]If (some criteria = something) Then (Somethin) Visable = True
Else
(somethin) Visable = False
End If

Exit_HideMyDoobry[/INDENT]

Err_HideMyDoobry
 MsgBox Err.Description
    Resume Exit_HideMyDoobry

End Sub

HTH
 
Eddie Mason said:
Is it possible to hide a field based on a condition, on a datasheet form, using the load event?
I don't think it's possible in datasheet view, but in SingleForm view you should put the code in the Form_Current() event. The code below will hide "YourField" if the ID field is less than 5.
Code:
Private Sub Form_Current()
  
    Me.YourField.Visible = IIf(Me.ID >= 5, True, False)
    
End Sub
HTH
 
Using the .visible does not work in datasheet. I've even changed the visible to no on the textbox format and it still appears when I change it to form view.

Regards

Eddie
 
Eddie Mason said:
Using the .visible does not work in datasheet. I've even changed the visible to no on the textbox format and it still appears when I change it to form view.

Regards

Eddie
Have you tried: Me.Address.ColumnHidden =True
 
Many thanks for your help the .columnhidden works perfectly.

Regards

Eddie
 
No problem. Im not very good with vb but Im beginning to think that just like windows, there seems to always be atleast two ways of doing something.
 

Users who are viewing this thread

Back
Top Bottom