Problem with subform parent/child linking

T

Tony M

Hi all. I have a form with a subform on it. The parent form is based
on a table with a two field primary key, consisting of a lot number
and a truck number. The subform is in a one to many relationship
based on lot number and truck number. In the properties of the
subform, I have set Link Child Fields and Link Master Fields to Lot
Number;Truck Number.

However, when a user tries adding a new record and types in a truck
number in the parent form, the subform brings up records that match by
truck number, but with a different lot number. Why is this? Is there
a way to prevent this?

Tony
 
M

Mark A. Sam

Tony,

Are Lot Number;Truck Number the actual field names you are using? Did you
enter them like you showed? You need brackets surrounding the name whenever
they include spaces:

[Lot Number];[Truck Number]

Also check that they are the same field format, like Text or Number.


God Bless,

Mark A. Sam
 
T

Tony M

Tony,

Are Lot Number;Truck Number the actual field names you are using? Did you
enter them like you showed? You need brackets surrounding the name whenever
they include spaces:

[Lot Number];[Truck Number]

Also check that they are the same field format, like Text or Number.


God Bless,

Mark A. Sam

Tony M said:
Hi all. I have a form with a subform on it. The parent form is based
on a table with a two field primary key, consisting of a lot number
and a truck number. The subform is in a one to many relationship
based on lot number and truck number. In the properties of the
subform, I have set Link Child Fields and Link Master Fields to Lot
Number;Truck Number.

However, when a user tries adding a new record and types in a truck
number in the parent form, the subform brings up records that match by
truck number, but with a different lot number. Why is this? Is there
a way to prevent this?

Tony

Thanks. I was using the actual field names that the controls were
based on, not the names of the controls themselves. I had
inadvertently changed the name of the lot number control. I guess it
tried to link on only the truck number, because it couldn't figure out
what to do with the lot number.

Tony
 

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