Control on subform not working properly

G

Guest

I have created a form that also displays a subform. The subform's record
source is from a table that is different from the main form and referential
integrity is enforced between the two tables. All controls on the subform
are working correctly except for the FK field. It displays the name of the
main form as a default. I can find no default settings on the subform or the
parent or child table so I do not know how this is happening. I am using MS
Access version 2000.

Also, I do have the Required property of the FK in my child table set to Yes.
 
S

Steve Schapel

Lorraine,

I am not sure what you mean by "it displays the name of the main form as
a default". The value of the Foreign Key field on the subform should
match the value of the Primary Key field on the main form. The name of
the main form is not relevant. The way this correspondence is usually
achieved is via the settings of the Link Master Fields and Link Child
Fields properties of the subform. What are these properties set to at
the moment?
 
G

Guest

Steve,
Source Object........Roads Subform
Link Child Fields.....Road Name (correct)
Link Master Fields..Name (correct)
Enabled................Yes
Locked..................No

This subform is placed on the Main Form entitled Inspection Input/Edit.

The control in my subform that is the child key displays the main forms name
of "Inspection Input" as a default rather than the Parent PK "Name". It
should be blank until I start to enter a record and then it should pick up a
value from the Parent table PK. What is preventing this?
 
S

Steve Schapel

Lorraine,

'Name' is a "reserved word" (i.e. has a special meaning) in Access, and
should not be used as the name of a field or control or database object.
Can you change the name of the Name field in the main form and it's
underlying table? If not, it may solve the problem if you can enclose
in []s like this [Name] in the Link Master Fields property setting.

By the way, as an aside, it is also not a good idea to use a / as part
of the name of an object, as in "Inspection Input/Edit".
 
G

Guest

Finally! Thank God and thank you Steve! I was going crazy trying to figure
this out. I renamed the PK field name and all is working now! Thanks so
much!
--
Lorraine


Steve Schapel said:
Lorraine,

'Name' is a "reserved word" (i.e. has a special meaning) in Access, and
should not be used as the name of a field or control or database object.
Can you change the name of the Name field in the main form and it's
underlying table? If not, it may solve the problem if you can enclose
in []s like this [Name] in the Link Master Fields property setting.

By the way, as an aside, it is also not a good idea to use a / as part
of the name of an object, as in "Inspection Input/Edit".

--
Steve Schapel, Microsoft Access MVP
Steve,
Source Object........Roads Subform
Link Child Fields.....Road Name (correct)
Link Master Fields..Name (correct)
Enabled................Yes
Locked..................No

This subform is placed on the Main Form entitled Inspection Input/Edit.

The control in my subform that is the child key displays the main forms name
of "Inspection Input" as a default rather than the Parent PK "Name". It
should be blank until I start to enter a record and then it should pick up a
value from the Parent table PK. What is preventing this?
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 

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