Dynamic subform

grnegsndhm

Registered User.
Local time
Today, 14:28
Joined
Aug 17, 2004
Messages
24
Hey folks,

I have a dynamic query being built where the field names change order and inclusion. The compile SQL is saved as into a query (qrySEARCH_RESULTS)

I want to display the results in a subform after they have selected all the fields they would like to add. Is it possible to have the subform be dynamic with regards to the fields it displays? I would like to see just the table view, no need to get overly fancy.

Thanks.
 
g,

If it wasn't for the "inclusion" part, you'd be OK. You wouldn't have the
sorted fields at the left margin, but one form, could do it all. You might
even do some tricks with VBA and move the fields around on the form.

It is possible to examine a query, build a form with the appropriate fields,
and have a truly dynamic form, but that is a lot of work!

There have been posts here (ChrisO programmatically builds forms), but
it is a LOT of work.

Wayne
 
thanks.

I look for the code. any ideas as to the location? Even if not accepted it would be nice to achieve away this code.
 
g,

Don't know where you'd look. People generally don't set out to do this.
For example, look at the forms that the MS Wizards generate. Not good.

Wayne
 
hey, just a quick thought...

Dynamically building a form in this way shouldn't be too difficult.

Try looping through a recordset of the query before the subform binds and creating a control and setting its control source for each rst.field

Its prob easier to display the form continuously rather than as a datasheet.

Youd need to position the controls along side each other also. But this can be achieved in the loop using a starting position of the first control.
 

Users who are viewing this thread

Back
Top Bottom