Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18011
Number of posts: 55384

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Dynamic Subforms Posted by Anthony A on 4 Oct 2005 at 7:57 AM
Okay, here is a really interesting problem that I ran into.

My organization needs to create an Access Database for evaluations of sessions they hold. They have various amounts of speakers at these sessions, which is not a definate amount. I want to create an easy to use form that allows the person doing data entry the abilty to select the amount of speakers that lectured, then have the form automatically update (dynamically create) that amount of subforms.

Any ideas? I figured the solution would be some VB code. Is this even possible?

Anthony
Report
Dynamic Subforms Posted by nyaradzaim on 4 Oct 2005 at 10:06 AM
Please forward the answers that you received

Report
Re: Dynamic Subforms Posted by Anthony A on 12 Oct 2005 at 7:18 AM
: Please forward the answers that you received
:
:

I'm not even sure if this is possible. Does anyone have any suggestions?
Report
Re: Dynamic Subforms Posted by aatkbd on 12 Oct 2005 at 1:04 PM
: : Please forward the answers that you received
: :
: :
:
: I'm not even sure if this is possible. Does anyone have any suggestions?
:


If you can give me an example of the table structure you use I might be able to help you.

My idea is to create blank records based on a number entered in a text box. Then use a continuous subform to display the records that need to be filled in. However, that is based on certian table structure. If you can tell the layout of your database I might be able to help you.

Report
Re: Dynamic Subforms Posted by weirdmix on 14 Oct 2005 at 3:09 PM
: Okay, here is a really interesting problem that I ran into.
:
: My organization needs to create an Access Database for evaluations of sessions they hold. They have various amounts of speakers at these sessions, which is not a definate amount. I want to create an easy to use form that allows the person doing data entry the abilty to select the amount of speakers that lectured, then have the form automatically update (dynamically create) that amount of subforms.
:
: Any ideas? I figured the solution would be some VB code. Is this even possible?
:
: Anthony
:


well. I think you can't dynamically create forms, I know a way to create other objects dinamically, say, textboxes, labels and so on.

I ask you this.. Do you need forms? Or maybe you can create as many tabs as you need (with a SSTab control) and inside the other objects?

that can be done, if you are interested, just send me a mail.

greetings..

Report
Re: Dynamic Subforms Posted by weirdmix on 14 Oct 2005 at 3:36 PM
: : Okay, here is a really interesting problem that I ran into.
: :
: : My organization needs to create an Access Database for evaluations of sessions they hold. They have various amounts of speakers at these sessions, which is not a definate amount. I want to create an easy to use form that allows the person doing data entry the abilty to select the amount of speakers that lectured, then have the form automatically update (dynamically create) that amount of subforms.
: :
: : Any ideas? I figured the solution would be some VB code. Is this even possible?
: :
: : Anthony
: :
:
:
: well. I think you can't dynamically create forms, I know a way to create other objects dinamically, say, textboxes, labels and so on.
:
: I ask you this.. Do you need forms? Or maybe you can create as many tabs as you need (with a SSTab control) and inside the other objects?
:
: that can be done, if you are interested, just send me a mail.
:
: greetings..
:
:

update
i think you can create a form dinamically, go to File, then New, then choose the VB Application Wizard, then select a MDI Document Interface.

There you should find some code that creates a form every time a user go to the file menu, new document, as you can guess, there has a be a "Form Base" to create another.

Hope helps..
Report
Re: Dynamic Subforms Posted by ranainnet on 18 Oct 2005 at 12:10 PM
This message was edited by ranainnet at 2005-10-18 15:27:5

: : : Okay, here is a really interesting problem that I ran into.
: : :
: : : My organization needs to create an Access Database for evaluations of sessions they hold. They have various amounts of speakers at these sessions, which is not a definate amount. I want to create an easy to use form that allows the person doing data entry the abilty to select the amount of speakers that lectured, then have the form automatically update (dynamically create) that amount of subforms.
: : :
: : : Any ideas? I figured the solution would be some VB code. Is this even possible?
: : :
: : : Anthony

you can create a form dinamically. create a variable as new form then just call its show method. But these forms will be all alike the 1st form. for example just do the following--

'let your first form is named form1. then do the following
dim NewDinamicForm as new form1
'then write the following code in the appropriate event
NewDinamicForm.Show
'========

But there is some trick to make the form show different. You will have to use all the controls in all the forms. This will make the program a bit Heavy. Suppose in the first form you need to put the number of dinamic forms you need (this will require only a text box in the first form) and in the dinamic forms you need many other controls like grid control and others.

To do this you will have to place all the controls (text box for inputting the number of dinamic forms you need later and the grid contorls + other contorls) in the 1st form. And to hide the unnecessary controls just set the visible property of the contorls to false.

you can put the
NewDinamicForms.Show
command in a loop which will continue the time you placed in the 1st form.

GoodLuck. (sorry for the spell mistakes)
_____________________________________________________________________________
Knowledge Is Power. Be Sure To Use This Power For Others WelFare. (;->






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.