By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,508 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

Main form with 2 subforms - Error: Method 'requery' of object '_Subform' failed

P: n/a
Hello,

I created a main form with 2 subforms.
In an attempt to move to the next record (or new record) on the main form I
get the error " Method 'requery' of object '_Subform' failed".

The database closes after answering the popup window (Microsoft Access has
encounterd a problem and needs to close. .....)

Does anybody has an idea why I'm having this problem?

--
Reginald Bal
Mar 1 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Reginald, these things can be quite difficult to trace. Does it happen if
you just use the built-in navigation buttons to move record?

Suggestions to solve known issues and help pinpoint the culprit:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. If this is Access 2002 or 2003, open your subform in design view, and add
a text box for the field(s) named in the LinkChildFields property of the
subform control if you don't yet have a text box in the subform. You can set
its Visible property to No if you wish. Repeat for the other subform. Then
open the main form in design view. Clear the LinkChildFields property, and
enter it again so Access discovers it now links to a text box instead of an
AccessField.

4. 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"

5. Open Access, and compact again.

6. 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

7. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

8. If you are using any code in the Current or Timer events of any of these
forms (main form or subforms), temporarily comment out the code.

At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, inconsistencies between the text- and
compiled-versions of the code are fixed, reference ambiguities are resolved,
the code syntax is compilable, and a known bug with the AccessField type is
averted.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Reginald Bal" <rb**@rebit.be> wrote in message
news:IN**********************@phobos.telenet-ops.be...
Hello,

I created a main form with 2 subforms.
In an attempt to move to the next record (or new record) on the main form
I get the error " Method 'requery' of object '_Subform' failed".

The database closes after answering the popup window (Microsoft Access has
encounterd a problem and needs to close. .....)

Does anybody has an idea why I'm having this problem?

--
Reginald Bal

Mar 2 '06 #2

P: n/a
Great!

Could solve the problem by your help.

Thanks a lot Allen!

Reginald

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...
Reginald, these things can be quite difficult to trace. Does it happen if
you just use the built-in navigation buttons to move record?

Suggestions to solve known issues and help pinpoint the culprit:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. If this is Access 2002 or 2003, open your subform in design view, and
add a text box for the field(s) named in the LinkChildFields property of
the subform control if you don't yet have a text box in the subform. You
can set its Visible property to No if you wish. Repeat for the other
subform. Then open the main form in design view. Clear the LinkChildFields
property, and enter it again so Access discovers it now links to a text
box instead of an AccessField.

4. 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"

5. Open Access, and compact again.

6. 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

7. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

8. If you are using any code in the Current or Timer events of any of
these forms (main form or subforms), temporarily comment out the code.

At this point, you should have a database where the name-autocorrect
errors are gone, the indexes are repaired, inconsistencies between the
text- and compiled-versions of the code are fixed, reference ambiguities
are resolved, the code syntax is compilable, and a known bug with the
AccessField type is averted.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Reginald Bal" <rb**@rebit.be> wrote in message
news:IN**********************@phobos.telenet-ops.be...
Hello,

I created a main form with 2 subforms.
In an attempt to move to the next record (or new record) on the main form
I get the error " Method 'requery' of object '_Subform' failed".

The database closes after answering the popup window (Microsoft Access
has encounterd a problem and needs to close. .....)

Does anybody has an idea why I'm having this problem?

--
Reginald Bal


Mar 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.