472,800 Members | 1,604 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,800 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 5947
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.