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 / New Users / August 2006

Tip: Looking for answers? Try searching our database.

Primary Key Textbox Linking to Subforms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dfowler-engineer - 10 Aug 2006 19:17 GMT
I have an issue that I can't quite figure out.  I have built a database that
will be used to store equipment information.  The main form/table contains
general information about the equipment.  I have set the primary key as a
specifically assigned "Equipment Number".  I have a subform/table that will
contain motor information for each particular "Equipment Number".  Since each
"Equipment Number" input in the main form can have multiple motors, there is
a One to Many relationship set up between the forms.  What I'm wanting to do
is as follows:

If I assign my equipment number as EQ-001 in the "Equipment Number" on my
main form and save it, I want to open the motor form and carry over the EQ-
001 into the "Equipment Number" on the subform.  I want this field to be
locked on the subform so that user can only view/add/edit data on EQ-001 and
not scoll to information on EQ-002 within the subform.  In other words, in
the subform, I want the user to be restricted to data associated with
whatever the current "Equipment Number" is set to on the main form.

I had this set up to work properly by setting the default value of "Equipment
Number" in the subform to "[Forms]![Main Form]![Equipment Number]".  It
worked fine, but all of the sudden it stopped working (it allows me to scroll
through the records of all Equipment Numbers within the subform).  I compared
all of the paramenters on my updated database with those of an older backup,
and I can't find anything that would have broken this.

Any suggestions would be greatly appreaciated.

Thanks,
David
KARL DEWEY - 10 Aug 2006 21:26 GMT
Create a one-to-many relation between the tables.
Create a query with both tables joined on "Equipment Number".
Use the same query as record source for both form and subform.
Set the Master/Child links in the subform to the "Equipment Number".

> I have an issue that I can't quite figure out.  I have built a database that
> will be used to store equipment information.  The main form/table contains
[quoted text clipped - 24 lines]
> Thanks,
> David
dfowler-engineer - 14 Aug 2006 15:32 GMT
Thank you for your help, Karl.  That took care of my issue!

>Create a one-to-many relation between the tables.
>Create a query with both tables joined on "Equipment Number".
[quoted text clipped - 6 lines]
>> Thanks,
>> David
 
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.