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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing Subform Columns When Not Used

Status
Not open for further replies.

TomHW

Programmer
Sep 8, 2004
100
US
I have a form that is used to search for information in a table. The form has a textbox for each field in the table and a checkbox next to each of those textboxes to determine if the user wants that field shown in the result of the search. The form builds a query based upon information in the fields and whether or not the boxes are checked. The resulting datasheet from the query needs to be shown to the user so that they may view info, copy info, or even resize the fields so that they can see more or less.

I was trying to use a subform in datasheet view to accomplish this task. The problem is that I have to put a textbox on the subform for each field in the table. Not every field is always viewed, so when I set the recordsource of the subform, some fields only display '#name?' Is there any way to have a subform show only the fields that are being used, or is there a better way to accomplish this task. I would like the information to show up on the same form as the search boxes (hence the subform idea) but I am open to suggestion.

Thanks,
Tom
 
For any controls on your form (textboxes, etc) just set their Visible property to False when you don't want them viewed, and to True when you do want them viewed.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top