A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Getting a subform control to requery



 
 
Thread Tools Display Modes
  #1  
Old February 18th, 2010, 12:15 AM posted to microsoft.public.access.forms
szag via AccessMonster.com
external usenet poster
 
Posts: 99
Default Getting a subform control to requery

Main Form : F_BU
Subform1: F_BU_Cat2
SubForm2: F_BU_Cat3

When I click on one of the records in subform1 (field BillCat) the OnClick
event uses the value in the field as a criteria in a query that is used in
the combox (cbxCat3) in Subform 2. Here is the code I was trying to use:

Me.Parent!F_BU_Cat3.Form!cbxCat3.Requery

It was working for a while but now not when I click on the "BillCat" field in
Subform 1 I get: Method: Form" of Object ' _Subform' Failed.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1

  #2  
Old February 18th, 2010, 08:10 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Getting a subform control to requery

I find that in A2007, I am seeing this error message every now and then,
whereas in A2003 and earlier, it was very rare.
I have found that small things wrong can give this error message.

Does the code compile?
Have you checked that the combo has the correct record source?, the forms
have correct record sources?
Have you checked for correct names of the objects involved?

Have you checked to see if any of the forms involved have been corrupted,
perhaps the combo has become corrupted.
I can't remember all the things that can give this error.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"szag via AccessMonster.com" u2885@uwe wrote in message
news:a3ca9b7cc5f36@uwe...
Main Form : F_BU
Subform1: F_BU_Cat2
SubForm2: F_BU_Cat3

When I click on one of the records in subform1 (field BillCat) the OnClick
event uses the value in the field as a criteria in a query that is used in
the combox (cbxCat3) in Subform 2. Here is the code I was trying to use:

Me.Parent!F_BU_Cat3.Form!cbxCat3.Requery

It was working for a while but now not when I click on the "BillCat" field
in
Subform 1 I get: Method: Form" of Object ' _Subform' Failed.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201002/1



  #3  
Old February 18th, 2010, 12:13 PM posted to microsoft.public.access.forms
szag via AccessMonster.com
external usenet poster
 
Posts: 99
Default Getting a subform control to requery

Thanks Jeanette - unfortunately I can't look at it right now but in the
meantime ...did the code look ok? I just picked that up from a differnet
thread.

Jeanette Cunningham wrote:
I find that in A2007, I am seeing this error message every now and then,
whereas in A2003 and earlier, it was very rare.
I have found that small things wrong can give this error message.

Does the code compile?
Have you checked that the combo has the correct record source?, the forms
have correct record sources?
Have you checked for correct names of the objects involved?

Have you checked to see if any of the forms involved have been corrupted,
perhaps the combo has become corrupted.
I can't remember all the things that can give this error.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

Main Form : F_BU
Subform1: F_BU_Cat2

[quoted text clipped - 9 lines]
in
Subform 1 I get: Method: Form" of Object ' _Subform' Failed.


--
Message posted via http://www.accessmonster.com

  #4  
Old February 18th, 2010, 10:47 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Getting a subform control to requery

Yes the code looked OK in a general way.
Now that I know you are adapting some other code, make sure you have the
correct name for the subform and the subform control.

Make sure that
Me.Parent!F_BU_Cat3.Form!cbxCat3.Requery

Is using the name of the subform control and not the name of the subform
inside the subform control.
The idea is shown below, substitute the name of your subform control.

Me.Parent.[NameOfSubformControl].Form.cbxCat3.Requery

Note that the subform may have a different name from the subform control.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"szag via AccessMonster.com" u2885@uwe wrote in message
news:a3d0df5f22389@uwe...
Thanks Jeanette - unfortunately I can't look at it right now but in the
meantime ...did the code look ok? I just picked that up from a differnet
thread.

Jeanette Cunningham wrote:
I find that in A2007, I am seeing this error message every now and then,
whereas in A2003 and earlier, it was very rare.
I have found that small things wrong can give this error message.

Does the code compile?
Have you checked that the combo has the correct record source?, the forms
have correct record sources?
Have you checked for correct names of the objects involved?

Have you checked to see if any of the forms involved have been corrupted,
perhaps the combo has become corrupted.
I can't remember all the things that can give this error.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

Main Form : F_BU
Subform1: F_BU_Cat2

[quoted text clipped - 9 lines]
in
Subform 1 I get: Method: Form" of Object ' _Subform' Failed.


--
Message posted via http://www.accessmonster.com




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.