473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
2 6026
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bill Clark | last post by:
I just had MS Access 97 loaded on my machine. When I try to use the Chart Wizard, I get an error stating: Method 'Form' of object '_Subform' failed Any thoughts? Is there something that...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
3
by: cannen | last post by:
This is a repost as I am down to the last hair on my head. I am using a listbox on a tab control on my mainform that has alisting of all records associated with form main record. when I select...
7
by: Stu | last post by:
Hi, I have a combobox who's values change the recordsource of the form. Within this form, there is a subform, whos records also need to change pending the value in the combobox. I am able to get...
8
by: lmurgas | last post by:
FormA = List of organization records bound to table FormB = Tabbed form with details of organization and all other related entities, such as orders, contacts, invoices, (all as subforms bound to...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
34
by: bitsnbytes64 | last post by:
Hi, I've been having a similar issue to what is described in the "refresh a form" post with a ComboBox that is not being refreshed after adding a new value on a seperate form. The second form is...
5
by: Thelma Roslyn Lubkin | last post by:
I am still having trouble trying to use a popup form to allow user to set filters for the main form. The main form is based on a single table. The popup contains 5 listboxes, so the user can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.