Dynamic Subform

spinkung

Registered User.
Local time
Today, 15:18
Joined
Dec 4, 2006
Messages
267
Hi All,

I am trying to set a subform based on a crosstab which a has variable rows and columns based on some form combo boxes.

I have got to the stage where i click a button that should update the subform to based on the parametres selected in the combo boxes.

I realise i can't create a subform based on my crosstab (or can i??) so i have a macro run when the button is clicked that creates a table based on the crosstab.

How do i then change my subform to show all of the new tables fields?? What is the VBA method for showing fields in your subform??

I have looked through the forums and can't seem to find anything that helps.

Many Thanks.
 
you can specify any number of 'fixed columns' that always appear in a crosstab.
You can enter this in the columns prperty of the xtab.
 
Thanks for your swift reply Dennisk.

Both my columns and rows change each time a search is performed.

I now have this code which i think almost works but won;t set the subform to the new tables data.....
Code:
DoCmd.SetWarnings False
Me.sFrm_Skills_Lookup.SourceObject = ""
DoCmd.RunMacro "mcr_CREATE_skills_matrix"   '  delete existing table and create new tables based on crosstab
Me.sFrm_Skills_Lookup.SourceObject = [COLOR="Red"]"tbl_LOOKUP_Skills_Matrix"[/COLOR]
DoCmd.SetWarnings True

...the red text is my tables that gets created. I want to set the subform to look at this table but i get an error message when i try saying the jet engine cannot find the object????
 
I guess dynamically changing a subform can't be done.


My next question then....

Is there a way i can create a subform on the fly and set it's recordsource so that all the columns are added???


thanks
 

Users who are viewing this thread

Back
Top Bottom