Gettin it To Work

T

Tom

Trying to set up a data entry form to populate some tables. In it I have a
sub form that is based on a query. The problem is, on each new record, the
entire query is displayed, not just the line item that pertains to the record
that is active. I have a "Repairs" table and a "Parts" table. The sub form
deals mainly with the parts. I enter a part number in the main section of
the form and the description of the part number populates in the query along
with a date calculation.

My problem is all the records of part numbers and descriptions show up in
the sub form. How do I only get the one that pertains to the main record??

Thanx
 
K

Klatuu

Your Subform is contained in a subform control on your main form.
There are two properties of the subform control that relate the recordsource
of the main form with the recordsource of the subform.
They are Link Master Fields(s) and Link Child Field(s)
In the Link Master Field(s) property, put the name of the field or fields in
the main form record source that relate to the record source of the sub form.
In the Link Child Field(s) property, put the name of the field or fields in
the subform's record source the relate to the record source in the main form.

It is just like setting relations between tables or joining table in a query.
 
T

Tom

Thanks, that got me down to one record for the form. I thought it was but on
inspection it seems the query is not populating my main table...

How do I get that to happen..

Thanx again
 
T

Tom

Thanks, this got me down to one record for the form. However, it seems my
data is not being sent to the main table as I thought it was..

How do I get this to happen..

Thanx again
 
K

Klatuu

Sorry, I don't understand the question. What do you mean by sending data to
main table?
 
T

Tom

I have a table, "Repairs" that I want to populate with data. I am using this
form as a data entry screen. When I enter data into the form, IU would like
this data to go into this "repairs" table. The subform, connected to a query
that pulls a part description from a "Parts" table after I enter the part
number in the main body of the form.

The information in the query (aka subform) is not getting inserted into the
main "repairs" table.
 
K

Klatuu

Tom,
I am a bit confused here. The main form will only populate records in the
recordsource of the main form. The subform will only populate records in the
recordsource of the subform.

I really don't know what you are trying to do.
 
T

Tom

OK, I'll try again. I'm trying to build a a database for repairs. One table
holds the repair information, one table holds the part number and part
description information.

I want to use a data entry form to populate the repair table. In the
repairtable there are fields for the part number and part description that,
when a part number is entered in the part number field, I would like the
description to be filled in automatically in the appropriate field.

My query on which my subform is based contains fields from both of the above
tables. and should (i hope) be able to populate the repairs table as the form
is filled in.

Can this be done or am I going about it all wrong....
 
K

Klatuu

Are you trying to associate the parts used for a repair? Can more than one
part be used in a repair?
 
J

John W. Vinson

The information in the query (aka subform) is not getting inserted into the
main "repairs" table.

You wouldn't WANT it to be. It would be totally redundant to store all of the
information about a Part (or multiple parts) into a Repairs table!

What are the Recordsources of the mainform and the subform? What information
are you trying to store in the Repairs table and why?

John W. Vinson [MVP]
 
T

Tom

Hello John... I want a record of what repair was done to that part on each
repair ticket. Redundancy is not an issue. I want each line item to have a
record of the repair and the part. Each repair is unique to that repair
ticket as is the part for that ticket.
 
J

John W. Vinson

Hello John... I want a record of what repair was done to that part on each
repair ticket. Redundancy is not an issue. I want each line item to have a
record of the repair and the part. Each repair is unique to that repair
ticket as is the part for that ticket.

For that purpose you need to store the unique PartID in the repair table, or
(more likely) in a RepairParts table related one to many to both the Repair
table and the Parts table.

It is certainly *not* necessary to store the part description in any table
other than the Parts table; you can retrieve the part description using a
Query joining to the parts table by the PartID.

John W. Vinson [MVP]
 

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