Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / November 2007

Tip: Looking for answers? Try searching our database.

Subform Columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stevo - 07 Nov 2007 20:48 GMT
Hi, I have a subform that is using a temporary table. The temp table is
deleted and repopulated via a query. The trouble is the amount of columns can
vary. Unfortunately the subform still shows the columns from the last time
the temp table was created. Is there a way that the subform can be refreshed
to show ONLY the columns that are in the temp table?
Erez Mor - 08 Nov 2007 10:26 GMT
hi
one way you can achive this is programaticaly show/hide the textboxes in the
subform according to the number of fields(columns) in the underlying table:
you have to know the maximum number of possible columns and have the subform
fit that - give the textboxes repetitive names like text1, text2....
then, in the event of rebuilding the subfom/table:
hide all the textboxes
for x=1 to 10
      me.controls("text" & x).visible=false
next x

and then, using a:
x=1
for each fld in [underlying table] fields
     me.controls("text" & x).controlsource=fld.name
     me.controls("text" & x).visible=true
     x=x+1
next fld

you bind and display only the amount of textboxes you need

hope it all made sense
Erez.

> Hi, I have a subform that is using a temporary table. The temp table is
> deleted and repopulated via a query. The trouble is the amount of columns can
> vary. Unfortunately the subform still shows the columns from the last time
> the temp table was created. Is there a way that the subform can be refreshed
> to show ONLY the columns that are in the temp table?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.