Dynamic forms in Access 2003

Posted on 2005-04-22
Last Modified: 2009-12-16

I need to build a fully dynamic form and wondered what your thoughts are. I know this question has been asked before (here... 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.


Question by:solution46
    LVL 39

    Accepted Solution

    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.

    LVL 9

    Author Comment


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

    Still, worked nicely like that so thanks.


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now