Full Version: Access & Relationship
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
viruzman
i have a DB, and a few tables, there is an autoID wich is the primary key. on my main interface i have a subform that grabs data from a second table. the problem i am having, is getting the subform to pickup the proper Data from the secondary table. in the second table if i enter A "1" in the If field, and then refresh my subform the data will pickup, but instead of this, i want the data to be picked up by the account number instead of auto Id, how can i accomplish this. like if i put the account number(44B77) in cell1 of table 2 and refresh the subform the data is not visible, but if i change the account# to 1, then the proper data shoes?!

Thanks in advance..
serge
fkegley
QUOTE (viruzman @ Mar 24 2010, 02:38 PM) *
i have a DB, and a few tables, there is an autoID wich is the primary key. on my main interface i have a subform that grabs data from a second table. the problem i am having, is getting the subform to pickup the proper Data from the secondary table. in the second table if i enter A "1" in the If field, and then refresh my subform the data will pickup, but instead of this, i want the data to be picked up by the account number instead of auto Id, how can i accomplish this. like if i put the account number(44B77) in cell1 of table 2 and refresh the subform the data is not visible, but if i change the account# to 1, then the proper data shoes?!

Thanks in advance..
serge


You need to tell the subform control which field to use when it fetches the corresponding record. Open the form containing the subform control in design view. Click the thick border around the subform control. Then click the Properties button. The properties you are interested in are the Link Master Fields and Link Child Fields properties.
theDBguy
Hi serge,

welcome2UA.gif

Proper relationship between a parent and child table should always be based on the Primary key of the parent table. However, if you want your subform to be linked to the account#, then you could modify the Link Master/Child Fields for your subform to show the account# field instead of the primary key.

Hope that helps...

EDIT: Oops, I guess Frank beat me to it. Sorry for the duplicate information.
viruzman
Excelent, i think this os something i might have overlooked, thank you both, smile.gif, worked great.
theDBguy
QUOTE (viruzman @ Mar 24 2010, 08:08 AM) *
Excelent, i think this os something i might have overlooked, thank you both, smile.gif, worked great.

yw.gif

Frank and I are happy to help. Good luck with your project.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.