How to hide some of subform textbox

jon2371

Registered User.
Local time
Tomorrow, 05:56
Joined
Aug 2, 2012
Messages
20
Hi Expert,

I have created a ParentForm & a SubForm, And i need to hide some textbox in subform. i already change the Visible Properties of Subform Textbox. But still when i click the formview of ParentForm, the subform textbox is still visible.

Please Help.

Thanks,
Jon
 
Try this code for every non-visible texbox in your subform, when the Parent Form loads:

Forms!Subform name here!texbox name here.Visible = False

Example:

Forms!Parent_Form!SubForm!nametextbox.Visible = False
 
I tried the syntax below:
I encountered error message..


Private Sub Form_Load()
Forms!HeadRejectMachF!DetailRejectMachSF!txtpostingdate2.Visible = False
End Sub

ParentForm Name : HeadRejectMachF
SubForm Name : DetailRejectMachSF
 
Your code has to be written when the main form loads

If I suppose that HeadRejectMachF is your main form and DetailRejectMachSF is the subform then:

Private HeadRejectMachF_Load()
Forms!HeadRejectMachF!DetailRejectMachSF!txtpostin_gdate2.Visible = False
End Sub

Also try using underscores (_) to seperate names in forms, text boxes etc just like the example above.

PS: I' ve tested the above code in one of my examples and it works (using different form and txt box names of course!)
 
Hi Sir Alex,

Still encounter error on Form Load, the txtpostingdate2 textbox is still visible.:banghead:

This is my syntax:
---------------------------
Private HeadRejectMachF_Load()
Forms!HeadRejectMachF!DetailRejectMachSF!txtpostingdate2.Visible = False
End Sub

Please Help...

Thanks,
Jon
 
This is the exact error if i load the Form.

Run-Time error '2465':

Reject Project can't find the field 'DetailRejectMachSF' referred to in your expression.
 
Thanks i already fixed the error..
thanks a lot
 

Users who are viewing this thread

Back
Top Bottom