Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to Unhide Columns 1

Status
Not open for further replies.

cutestuff

Technical User
Sep 7, 2006
162
CA
hi,

Someone please help.
I have the following code:

Me.qryEditMain_subform.Form.AllowAdditions = True
DoCmd.Echo False
strForm = Me.qryEditMain_subform.SourceObject
DoCmd.RunCommand acCmdDesignView
DoCmd.OpenForm strForm, acFormDS
DoCmd.RunCommand acCmdUnhideColumns
DoCmd.Close
DoCmd.RunCommand acCmdFormView
DoCmd.Echo True

I have a subform that I've hidden some columns (3 in fact). What I am trying to do is when a user clicks a button ("Add"), I am trying to "Allow Additions" and unhide the 3 columns I've hidden. The user is not supposed to see these if they are not adding stuff. The code above works except I want to automatically unhide the columns and not give the users the unhidecolumns dialog box.

Any ideas? Please?
Thanks ever so much...
 
How about

[tt]Me.qryEditMain_subform.Form.[Control Name].ColumnHidden = False[/tt]
 
hi Remou,

Will my control name be the name of my subform (since it has the hidden columns) or the name of the columns itself (for instance my hidden columns are: system, item, form)?

thanks for the help.
 
Control name is the name of the hidden column. The example above is intended to run on your main form.
 
OMG!

It WORKS!!!!

Thank you, thank you, THANK YOU!



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top