A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Subform Columns



 
 
Thread Tools Display Modes
  #1  
Old November 7th, 2007, 08:48 PM posted to microsoft.public.access.forms
Stevo
external usenet poster
 
Posts: 25
Default Subform Columns

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?
  #2  
Old November 8th, 2007, 10:26 AM posted to microsoft.public.access.forms
Erez Mor
external usenet poster
 
Posts: 16
Default Subform Columns

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.


"Stevo" wrote:

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?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.