establishing sub forms existing forms

D

Danny

I was curious if this is possible. I have approx 4 or 5 forms that
update different tables in the database. Is it possible to establish
a sub form on these 4 or 5 forms, without having to rebuild from
scratch? The intent would be so users can enter information into
each form without having to open each form.
 
J

John W. Vinson

I was curious if this is possible. I have approx 4 or 5 forms that
update different tables in the database. Is it possible to establish
a sub form on these 4 or 5 forms, without having to rebuild from
scratch? The intent would be so users can enter information into
each form without having to open each form.

Sure. Open the Form in design view; use the Subform tool on the toolbox to add
a subform. If you have the toolbox "magic wand" icon selected, a wizard will
walk you through; you can add an existing form, or create a new subform.

It is important that the *tables* upon which the forms are based be
appropriatelyh related. YOu can't just throw a bunch of unrealated forms
together and expect to get good results...

John W. Vinson [MVP]
 
G

Guest

I'm still pretty new with all this but I would say yes. I had my forms set
up that way but then I changed my subforms to read only. But in the
beginning I did enter in my info on the subforms and it updated my tables as
it should. As long as your forms are drawn from your tables and your tables
are related correctly you should have no problems.
 
D

Danny

I'm still pretty new with all this but I would say yes. I had my forms set
up that way but then I changed my subforms to read only. But in the
beginning I did enter in my info on the subforms and it updated my tables as
it should. As long as your forms are drawn from your tables and your tables
are related correctly you should have no problems.





- Show quoted text -
Thanks for your responses. A couple of things I was wondering.

The tables are table 1 has a one to many relationship with table 2 and
3. Table 2 has a 1 to many relationship to table 4 and 5.

Would a sub form work in this fashion or would something else be
needed to make this work?

When looking at the sub form using the wizard it shows all data fields
basically on one form in form view. Is there away to set up a sub
form that looks like a single form type in form view and to tab to the
other forms?
 
J

John W. Vinson

The tables are table 1 has a one to many relationship with table 2 and
3. Table 2 has a 1 to many relationship to table 4 and 5.

Would a sub form work in this fashion or would something else be
needed to make this work?

Subforms can be nested (an absurd seven layers deep, if you want to be that
cruel to your users). Two layers is easy... see below.
When looking at the sub form using the wizard it shows all data fields
basically on one form in form view. Is there away to set up a sub
form that looks like a single form type in form view and to tab to the
other forms?

The Wizard isn't very clever, frankly. You can start with the wizard's form
and then customize it.

I'd use:

- a main form (frmMain let's call it) based on Table1, or a query sorting the
data in Table1
- Two subforms on frmMain, based on Table2 (sub2) and Table3 (sub3)
respectively
- You can open the form used in sub2 and view its Properties. Change the
Default View from Datasheet to Single (and you may want to disallow Datasheet,
Pivot Table, and the other irrelevant views).
- Put two subforms on sub2 based on Tables 4 and 5.

If you need more screen real estate, you can put a Tab Control on frmMain; put
sub2 and its subforms on one page, sub3 on another.

Normally a subform is used for the "many" side of a relationship; when you
finish a record on the subform, it will by default go to a new record on that
subform so you can keep adding records. Typing Ctrl-Tab will tab out of the
subform to the next control in the main form's tab order (which may well be
another subform). There's tricks to make it tab automatically to the next
subform as soon as you finish a record - but that should only be done if you
very rarely have two or more child records.

John W. Vinson [MVP]
 
D

Danny

Subforms can be nested (an absurd seven layers deep, if you want to be that
cruel to your users). Two layers is easy... see below.


The Wizard isn't very clever, frankly. You can start with the wizard's form
and then customize it.

I'd use:

- a main form (frmMain let's call it) based on Table1, or a query sorting the
data in Table1
- Two subforms on frmMain, based on Table2 (sub2) and Table3 (sub3)
respectively
- You can open the form used in sub2 and view its Properties. Change the
Default View from Datasheet to Single (and you may want to disallow Datasheet,
Pivot Table, and the other irrelevant views).
- Put two subforms on sub2 based on Tables 4 and 5.

If you need more screen real estate, you can put a Tab Control on frmMain; put
sub2 and its subforms on one page, sub3 on another.

Normally a subform is used for the "many" side of a relationship; when you
finish a record on the subform, it will by default go to a new record on that
subform so you can keep adding records. Typing Ctrl-Tab will tab out of the
subform to the next control in the main form's tab order (which may well be
another subform). There's tricks to make it tab automatically to the next
subform as soon as you finish a record - but that should only be done if you
very rarely have two or more child records.

John W. Vinson [MVP]

Sorry so late on the post. Thanks for the input and information, I
really appreciate it you helped a lot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top