PC Review


Reply
Thread Tools Rate Thread

Adding controls to a form

 
 
g.vanswaaij@gmail.com
Guest
Posts: n/a
 
      15th Jun 2005
Hi everyone,

I am currently working on a database in which the results of an
extensive questionnaire will be stored. To facilitate adding or
removing questions later on, the form that has to be filled in is
dynamically generated.

Unfortunately, I'm quite new to VBA, and I can't find out how to add a
control to the Forms!FormName!Controls collection. According to the MS
VBA Reference, this collection has no Add function, so how else do I
have to do it? Adding them in the form design view, then setting their
visibility to false, and then letting the script switch the visibility
of the needed controls to true is not really an option, since there is
no way to tell in advance how many questions and possible answers will
appear on one page of the form.

Thanks in advance!

 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      15th Jun 2005
(E-Mail Removed) wrote:
> Hi everyone,
>
> I am currently working on a database in which the results of an
> extensive questionnaire will be stored. To facilitate adding or
> removing questions later on, the form that has to be filled in is
> dynamically generated.
>
> Unfortunately, I'm quite new to VBA, and I can't find out how to add a
> control to the Forms!FormName!Controls collection. According to the MS
> VBA Reference, this collection has no Add function, so how else do I
> have to do it? Adding them in the form design view, then setting their
> visibility to false, and then letting the script switch the visibility
> of the needed controls to true is not really an option, since there is
> no way to tell in advance how many questions and possible answers will
> appear on one page of the form.
>
> Thanks in advance!


Your questions should be rows in a related table, Then you can
add/remove/change questions without it affecting the design of your form at
all. Even if you could easily add controls at runtime to an Access form you
will quickly hit a lifetime limit of 754 controls for the form.

I don't have the link handy, but search these groups for "at your survey".
It is an Access app that demonstrates a structure for creating flexible
surveys using Access.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding controls to a dynamic form? Connor T Microsoft VB .NET 4 29th Nov 2004 06:58 PM
Adding controls to a dynamic form? Connor T Microsoft VB .NET 3 16th Nov 2004 08:31 PM
Dynamic Controls and Adding it to the Form First. Why? Tyler Carver Microsoft ASP .NET 3 18th Aug 2004 04:53 PM
Dynamically adding controls to a form HSalim Microsoft Access VBA Modules 1 29th Sep 2003 12:06 AM
Adding controls to the form... help Arthur Dzhelali Microsoft VB .NET 3 19th Sep 2003 04:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:36 AM.