• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 774
  • Last Modified:

Dynamic forms in Access 2003

All,

I need to build a fully dynamic form and wondered what your thoughts are. I know this question has been asked before (here... http://www.experts-exchange.com/Databases/MS_Access/Q_20740355.html) but this was a while ago and I'm wondering if any of you have any other ideas.

In short, the user can define a series of 'questions and answers'. These questions can have a variety of different types of answers (current data types are long text, a series of checkboxes, a drop-down option list and short text). These will need to be represented on a form, which obviously is initially undefined. The table structure is defined and working; it is just rendering the form that is causing me problems.

My eventual aim is to get this written in ASP.NET. However, before I get that far I need to sort out a working demo / prototype and, rightly or wrongly, I have chosen Access to do this. The good thing is that the system will never be 'live' so it doesn't have to be massively resilient and frequent compact & repairs wont be an issue.

Options I have so far are:
1. A continuous form bound to a table of Qs and As. Each record will have a combo box, series of check boxes and so on; various controls to be hidden / shown as required. I think this can be done with conditional formatting but it doesn't lend itself at all well to the varying physical sizes of the questions (some may have a single line of text, some may have a dozen or more checkboxes to list).
2. Writing the form in code using CreateControl.

At the moment, option 2 is my preferred route (bit of a nightmare to write but flexible enough to be possible) but I want to know if you have any other ideas.

As this is both quite tricky and bl**dy urgent :), max points are available and I'll open up another q to give more points for staggeringly good suggestions.

Cheers,

s46.
0
solution46
Asked:
solution46
1 Solution
 
stevbeCommented:
for a quick and dirty demo I would make a form with a boat load of each type of control you intend them to be able to define and then show/hide/set properties at runtime rather than wading through all of the CreateControl syntax.

The only limit on the number of controls on a form is something like 754 over the *lifetime8 of the form. THis means if you add a textbox nad then delete it, Access continues to increment the control counter. This should not be an issue because you will only be building this 1 time.

Steve
0
 
solution46Author Commented:
stevbe,

not sure why cheating didn't occur to me too!

Still, worked nicely like that so thanks.

s46.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Tackle projects and never again get stuck behind a technical roadblock.
Join Now