You must use the same number of fields when you set the LinkChild

G

Guest

On open of a form with a sub-form I receive this access error messages: You
must use the same number of fields when you set the LinkChildfields and
LinkMaster Fields property.
I have set Gage ID as the Master and GageID as the child. The master table -
"Gage basic" is related to the child table - "Gage History" and is linked as
a one to many , enforce integrity relationship in Relationship view.

The Gage History sub-form properties indicate the Link Child Field is set as
"GageID", and the Link Master Field is set as "Gage ID".

How do I fix this issue?
 
A

Allen Browne

Include square brackets around the name that contains the space:
[Gage ID]

Access should then understand you are not talking about 2 fields.
 
R

Rick Brandt

Connector said:
On open of a form with a sub-form I receive this access error messages: You
must use the same number of fields when you set the LinkChildfields and
LinkMaster Fields property.
I have set Gage ID as the Master and GageID as the child. The master table -
"Gage basic" is related to the child table - "Gage History" and is linked as
a one to many , enforce integrity relationship in Relationship view.

The Gage History sub-form properties indicate the Link Child Field is set as
"GageID", and the Link Master Field is set as "Gage ID".

How do I fix this issue?

Field names with spaces in them need [ ] around them. [Gage ID]
 
G

Guest

Allen,
Steps I took to fix the problem:
1) Used [ ] around the Gage ID field ....then opened the form and/or
navigated to next record....same error message returned.
then tried
2) Changed field name from Gage ID to GageID (removing the space)...reviewed
properties of sub-form. Link Child and Link Master fields indicated GageID
and GageID respectfully. Opened the form and/or navigated to next record
while in form view......same error message returned.

Are there other methods to fix this problem.?



Allen Browne said:
Include square brackets around the name that contains the space:
[Gage ID]

Access should then understand you are not talking about 2 fields.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Connector said:
On open of a form with a sub-form I receive this access error messages:
You
must use the same number of fields when you set the LinkChildfields and
LinkMaster Fields property.
I have set Gage ID as the Master and GageID as the child. The master
table -
"Gage basic" is related to the child table - "Gage History" and is linked
as
a one to many , enforce integrity relationship in Relationship view.

The Gage History sub-form properties indicate the Link Child Field is set
as
"GageID", and the Link Master Field is set as "Gage ID".

How do I fix this issue?
 
R

Rick Brandt

Connector said:
Allen,
Steps I took to fix the problem:
1) Used [ ] around the Gage ID field ....then opened the form and/or
navigated to next record....same error message returned.
then tried
2) Changed field name from Gage ID to GageID (removing the space)...reviewed
properties of sub-form. Link Child and Link Master fields indicated GageID
and GageID respectfully. Opened the form and/or navigated to next record
while in form view......same error message returned.

Are there other methods to fix this problem.?

You're not trying to change the MasterLink and ChildLink properties in code are
you?
 
G

Guest

No

Rick Brandt said:
Connector said:
Allen,
Steps I took to fix the problem:
1) Used [ ] around the Gage ID field ....then opened the form and/or
navigated to next record....same error message returned.
then tried
2) Changed field name from Gage ID to GageID (removing the space)...reviewed
properties of sub-form. Link Child and Link Master fields indicated GageID
and GageID respectfully. Opened the form and/or navigated to next record
while in form view......same error message returned.

Are there other methods to fix this problem.?

You're not trying to change the MasterLink and ChildLink properties in code are
you?
 
G

Guest

Basically I let the Access engine develop the links via the relatinships I
created, one to many, enforce integrity, in the Tools Relationships window.
I currently have approximately 1000 records in the basic table and 3000
records in the history table. I have an Gage Control operator input data
using the database and for 10 months there were no problems with form
opening, inputing data, running querries, etc. I completed a full virus scan
Connector said:
Allen,
Steps I took to fix the problem:
1) Used [ ] around the Gage ID field ....then opened the form and/or
navigated to next record....same error message returned.
then tried
2) Changed field name from Gage ID to GageID (removing the space)...reviewed
properties of sub-form. Link Child and Link Master fields indicated GageID
and GageID respectfully. Opened the form and/or navigated to next record
while in form view......same error message returned.

Are there other methods to fix this problem.?

You're not trying to change the MasterLink and ChildLink properties in code are
you?
 
R

Rick Brandt

Connector said:
Basically I let the Access engine develop the links via the relatinships I
created, one to many, enforce integrity, in the Tools Relationships window.
I currently have approximately 1000 records in the basic table and 3000
records in the history table. I have an Gage Control operator input data
using the database and for 10 months there were no problems with form
opening, inputing data, running querries, etc. I completed a full virus scan
on my C:\ drive and found no viruses. The database resides on the network S:\
drive.

Do you get the error if you blank the two properties out altogether?
 
G

Guest

When I remove GageID from the Link Child Fields property and the Link Master
Fields property and then open the form in form view, I do not get the error
message.
Opening the form and navigating to the next record, the Gage basic
information advances to the next record but the sub-form Gage History data
remains static.
 
R

Rick Brandt

Connector said:
When I remove GageID from the Link Child Fields property and the Link Master
Fields property and then open the form in form view, I do not get the error
message.
Opening the form and navigating to the next record, the Gage basic
information advances to the next record but the sub-form Gage History data
remains static.

Have you tried using the wizard tool to enter the properties instead of manually
typing them?
 
G

Guest

Yes I have tried both methods wizzard and manual. I have also designed a new
form'subform based on the same Gage basic table and Gage history table. Same
error results.
 
A

Allen Browne

Okay, if you still receive the error message that you need to have the same
number of fields in the LinkMasterFields and LinkChildFields when in fact
you have only 1 field there, and you have tried all the things Rick
suggested, I think Access has become confused, and Name AutoCorrect is the
most likely culprit.

Try these steps.
1. Remove the entries from the LinkMasterFields and LinkChildFields
properties. (We will put them back later.)

2. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://members.iinet.net.au/~allenbrowne/bug-03.html

3. Compact the database:
Tools | Database Utilities | Compact.

4. Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

5. Compact again, to get completely rid of the garbage.

6. Open the subform in design view. If there is no text box for GageID, then
add one. Set its Visible property to No if you wish, but it must be there.
(This is really important in Access 2002 and 2003 only, but is a good idea
anyway in case the database is converted.) Save and close the subform.

7. Open the main form in design view, and set the LinkMasterFields and
LinkChildFields properties.

Let's know how you go.
 

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