Initially I was using a saved form and programically removing and
adding controls as needed. Eventually this approach didn't work,
after a few days, after heaps of testing an error message claimed that
I'd used all the controls available. I suppose Access keeps a record
of previously deleted controls and I exceeded the limit.
So then I decided to programically create the sub-form from scratch and
therefore avoid the too many controls issue as mentioned above. This
failed in that I can't use this approach in an MDE (hence the posting).
I suppose what you suggest is do-able, using a saved form, that
contains, say a 100 controls (would never need that many - would be
between 12-20) and set the record sources etc when needed. I didn't
think of that approach a few days ago, as I would have tried it.
I've since solved my problem by utilsing a listbox as the displaying
object and changing the row soure, columnwidths, columncount etc as
required for the cross-tab. I shied away from this approach at the
start as it seemed like a lot of work to double-click on particular
row/column. In the end I had no choice and subsequently messed around
with the mousedown and doubleclick events to achieve what I wanted.
Thanks for your input and advice.
Steve.
Tom van Stiphout wrote:
On 19 Sep 2006 19:45:33 -0700, "superjacent" <su*********@gmail.com>
wrote:
It is true that there is no code generation in MDE. Thank Bill for
that :-)
If you MUST have MDE, you have to relax your requirements.
I haven't tried, but perhaps you can create a subform with the maximum
number of fields, and then bind them on the fly based on how many
columns your crosstab outputs.
-Tom.
Hope someone can help.
I have a saved parent form containing an unbound sub-form. I set the
SourceObject (form) after the Parent Form opens/loads.
The sub-form (datasheet view) basically displays the results of a
cross-tab query The cross-tab query is created dynamically (in code)
as the column headings are subject to change.
I therefore have to create a new form (in code) and add the necessary
controls (fields) as per the fields in the cross-tab query.
The reason why I want a form as the SourceObject of the sub-form is
that it allows Event Procedures to be activated. Using a straight
query (in my case a cross-tab query) as the SourceObject, I can't see
how I can activate any click or double-click events in the query cells
(I hope I'm wrong about this).
I've now noticed that this approach doesn't work in an MDE file as the
design mode is off.
Any suggestions or work-arounds.
Steve.