Error message when opening form

  • Thread starter Slez via AccessMonster.com
  • Start date
S

Slez via AccessMonster.com

I get the following error message when I open a particular form with
subforms"

The LinkMasterFields property setting has produced this error: 'User-defined
type not defined'

I can click OK, and everything in the forms works fine. I have a similar
combination of mainform/subforms in another database and they are linked the
same, but I've never received this error before. What should I be looking
for that would produce this?
Any suggestions are apprreciated.
 
A

Allen Browne

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
 
S

Slez via AccessMonster.com

Thanks Allen! I went into the database today to try to resolve the problem,
and interestingly enough, there was no error message. Everything works
perfectly today...I'm not sure why...but I'm going to use the philosophy "If
it ain't broke, don't fix it."

If it reappears, I'll put your method to work.
Thanks for taking the time to reply!
Slez
 

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