| View previous topic :: View next topic |
| Author |
Message |
glars Newbie

Joined: 29 Oct 2008 Posts: 1
|
Posted: Wed Oct 29, 2008 2:07 pm Post subject: question on updating a 3rd - intermediate table using forms |
|
|
for simplicity, i have 2 tables:
- parts_tbl ( parts_id, parts_name )
- acct_tbl ( acct_id, acct_name )
here, parts_id & acct_id are primary keys.
the 2 tables have a many-to-many relation. consequently, i use a 3rd intermediate table:
- p-a_tbl ( p-a_id, parts_id, acct_id )
here, p-a_id is a primary key and i established unique ( parts_id, acct_id ).
currently, i have setup the parts_tbl as the mainform and the p-a_tbl as the subform. i also have added the acct_tbl as a 2nd mainform in the form via the form navigator.
consequently, i can select a parts_tbl.parts_name and have the p-a_tbl.parts_id automatically established. in addtion, i select an acct_tbl.acct_name to identify the associated acct_tbl.acct_id and then manually enter this into the p-a_tbl.acct_id.
although this works, it is overly complicated for the nominal user - 1) the manual step is a potential source of error during entry, 2) the p-a_tbl should really be hidden from the user.
so, my questions are associated with these 2 issues:
1) is there a way to modify my approach to permit the user to select acct_tbl.acct_name and have the p-a_tbl.acct_id updated automatically rather than manually?
2) is it possible to display only the parts_tbl.parts_name and acct_tbl.acct_name and then, on acceptance of the entries, have the components of the p-a_tbl table filled in. |
|
| Back to top |
|
 |
Brivot General User

Joined: 08 Nov 2008 Posts: 9 Location: Côte d'Azur
|
Posted: Sat Nov 08, 2008 1:42 am Post subject: 3 tables |
|
|
Only solution I found was to create a request :
Req = parts + accts fields
this shows up into p-a_tbl.acct only when "someting new" is entered into p-a_tbl.acct.
To get around this pb, I added a binary field called parts_tbl .registed. When the user clicks on a checkbox called "selected", the reccord is selected and goes into the request.
Sorry, not able to help more.
mdb |
|
| Back to top |
|
 |
Voobase OOo Advocate


Joined: 21 Nov 2007 Posts: 400 Location: Australia
|
Posted: Sat Nov 08, 2008 5:13 am Post subject: |
|
|
| Quote: | | in addtion, i select an acct_tbl.acct_name to identify the associated acct_tbl.acct_id and then manually enter this into the p-a_tbl.acct_id. |
Hopefully I'm not off track here, but couldn't you use a listbox in your subform (p-a_tbl ) to bring in the account ID. A listbox can display one thing (account name) and bind something different (account ID) into the form it sits in. Before you draw the listbox into your subform, make sure you have the "wizards" button pressed in on the "form control" toolbar and the wizard should step you through it.
Alternatively you could do things the opposite way and have your p-a_tbl in a subform connected to the account form (mainform) and use the listbox to bring in the part number's ID instead.
| Quote: | | 2) the p-a_tbl should really be hidden from the user. |
If this table is hidden, then how is the user going to know they have initiated a connection between a part number and an account. Maybe you should dress the subform up so that it shows only what the user needs to see. If a listbox copies the account ID into the p-a_tbl's subform then it dosen't need to be displayed. You could write a simple macro to copy the name of the account accross at the same time, which would read well for the user.
Cheers
Voo |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|