Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2005

Tip: Looking for answers? Try searching our database.

subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pam Coleman - 19 Oct 2005 15:35 GMT
I have a main form and subform, the main form pulls infor from an emp query  
when the emp # is typed, the subform has an emp # field that is filled in
with whatever emp# is typed in the main form.  When I run a query that uses
the emp q and the badge table and I connect them by emp#, I get all the
information correct except it pulls out the same emp information on all the
records.  What am I doing wrong?  On my subform I have linked the parent and
child with the emp#.

Thanks.
BruceM - 19 Oct 2005 16:15 GMT
Have you created a relationship between the main form's record source (I
will call it tblMain) and the subform's record source (tblSub)?  If so, and
if I understand your situation correctly, it needs to be a relationship
between a primary key field in tblMain and a corresponding foreign key field
in tblSub (EmployeeID in your case, I would think).  When creating the
relationship you would check the box for Enforce Referential Integrity.  If
EmployeeID is the key field, and if you relate the tables one-to-many, then
the subform record will show EmployeeID in a control bound to that field.
You will not need to enter it separately in the subform.  For that matter,
there is probably no real need to show it in the subform.  You don't need
every possible field to appear on the form.
By the way, if your main form is based on a query, everything I have said
about relationships applies to the query's underlying table, not to the
query itself.  If you create relationships between tables, queries based on
those tables will inherit the relationships.

>I have a main form and subform, the main form pulls infor from an emp query
> when the emp # is typed, the subform has an emp # field that is filled in
[quoted text clipped - 8 lines]
>
> Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.