Primary Key Textbox Linking to Subforms

  • Thread starter dfowler-engineer via AccessMonster.com
  • Start date
D

dfowler-engineer via AccessMonster.com

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
 
K

KARL DEWEY

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".
 
D

dfowler-engineer via AccessMonster.com

Thank you for your help, Karl. That took care of my issue!

KARL said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top