LinkMasterFields is a property of the subform control.
To see what it contains:
- Open the main form in design view.
- Right-click the edge of the subform control, and choose Properties.
It's on the Data tab.
What does it refer to? Is there a text box on the main form with that name?
If you can't see anything wrong with it, there are a couple of Access bugs
that might be influcing this. Try this sequence:
1. Jot down the entries for LinkMasterFields and LinkChildFields. Delete
both properties. Save. Close the form.
2. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
3. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact/Repair
4. If LinkMasterFields referred to a field in the source of the main form
that is not a control on the form, add a text box for this field. (This is
important to avoid a bug with the AccessField data type.) You can set the
control's Visible property to No if you wish.
5. Likewise, if LinkChildFields refers to a field in the source of the
subform that is not a control in the subform, add a text box for that
control.
6. Close Access. Make a backup copy of the file. Decompile 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"
7. Open Access (holding down the Shift key if you have any startup code),
and compact again.
8. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html
9. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.
At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, you have worked around the AccessField
bug, inconsistencies between the text- and compiled-versions of the code are
fixed, reference ambiguities are resolved, and the code syntax is
compilable.
If it is still a problem, the next step would be to get Access to rebuild
the database for you. Follow the steps for the first symptom in this
article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html