We help IT Professionals succeed at work.

Needs help in subform

mustish1
mustish1 used Ask the Experts™
on
I try to create a subform of COA but couldnt find that option which create subforms in the menu needs help

Thanks.

form.jpg
link.jpg
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
MIS Liason
Most Valuable Expert 2012
Commented:
There is no Ribbon command to create subforms directly.

If the two tables are related already, as you are showing, then all you have to do is Select  (Not open, ...just Select) the main table in the Task pane and click: Create-->Form
This should create a Main/subform automatically.

Or, ... Open the main form in design View
Click: Design
Then from the controls section, select the subform/Subreport icon.

Or, ...
You have to make the subform by itself, then "Insert" in into the main form manually in design view.
Create the main form
Create the subform
Open the main form in design view
Drag the subfrom from the task pane into the main form

I prefer the last way because this creates and uses a Real subform.  The other two techniques simply create a subform "Control" out of the child table

;-)

JeffCoachman
The key point is that a subform is any regular form, table, or query inserted into an existing form.
If it needs to be a datasheet, use the wizard and create the 'subform' from a table or query.

If it needs a different look, create the form from the COA table.
When you insert the form into Voucher form, Access will add the code to only show the related records.
You can drag and drop the form or you can use the subform wizard to place an COA form into your Voucher form.
But, you first create a COA form.

Author

Commented:
I insert the COA form into voucher form but when i run the form it will not change the values into coa based on the voucher form
vou.jpg
If you dropped the form in from the Navigation pane, you have to manually set the synch (Master-Child fields) in the properties.

If you use the subform/subreport form control and use the wizards, Access will step you through setting the synch.
Using your sample data, see attached.
The Subform wizard creates the subform relationship.
The added default value for the subform account code, sets the value for new records.
Subform.accdb

Author

Commented:
When I use the wizard it ask me how do you want to view the data when i select voucher it dont show me the subform but when i select COA it shows me the subform option. I want to create form voucher with subform COA not COA with subform voucher.
wiz.jpg
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Then it seems that you are trying to create your form from a Multi table query.

*Keep It Simple*
As we have said:
Create the main form from just the main (parent) table.
Then create the sub form from the Child table.
The open the main form in design view and drag the subform into the main form.

Try this first and see how it works.

You can try this with the multi-table query later...
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
DoDahD,
<If you dropped the form in from the Navigation pane, you have to manually set the synch (Master-Child fields) in the properties.>

In more recent versions of Access, I have found that Access automatically sets the Parent/Child links, if it sees the one direct relationship

;-)

Jeff

Author

Commented:
>Create the main form from just the main (parent) table.
I did create the main form using form wizard

>Then create the sub form from the Child table.
Im sorry i couldnt find the option in access 2010 which create subform



There is no Create, Subform option in the ribbon.
To Add a subform into an existing form, one uses the Subform/Subreport control from the Controls ribbon when in Design View on a form.

Did you open the working sample database I posted earlier?

Author

Commented:
Yes but i dont know how you create it.
To Add a subform into an existing form, one uses the Subform/Subreport control from the Controls ribbon when in Design View on a form.

Author

Commented:
Yes i found the control it was in the design view. Thanks