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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|