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
|
|||
|
|||
Requery Subform
I have a main form (no data source) that I use to hold objects for navigation
(QBF fields & buttons, Report form buttons...) On the this form I placed a subform (PendingCalls) based on query to give show the basics of pending calls only, on that subform is a button that launches a seperate form PendingCallDetail. When I click the Close button on PendingCallDetail, I would like the form to close and update the subform on the main page. I've been playing with requery for weeks, trying some of the suggestions but nothing seems to work. I've tried both macro and code. How do I refer to the Subform of one form from third form? I keep messages about control not existing. Lori |
#2
|
|||
|
|||
Requery Subform
I would use the Unload event of the detail form. The correct syntax is:
Forms!FormName!SubFormControlName.Form.Requery Note: SubFormControlName is the name of the subform control on the main form. It is not the name of the form being used in the subform control. Access will, be default, name them the same, but IMHO, they should not have the same name. -- Dave Hargis, Microsoft Access MVP "Lori" wrote: I have a main form (no data source) that I use to hold objects for navigation (QBF fields & buttons, Report form buttons...) On the this form I placed a subform (PendingCalls) based on query to give show the basics of pending calls only, on that subform is a button that launches a seperate form PendingCallDetail. When I click the Close button on PendingCallDetail, I would like the form to close and update the subform on the main page. I've been playing with requery for weeks, trying some of the suggestions but nothing seems to work. I've tried both macro and code. How do I refer to the Subform of one form from third form? I keep messages about control not existing. Lori |
#3
|
|||
|
|||
Requery Subform
Dave~
See this is where I keep getting messed up after reveiwing the posts here. I called the main form: f_Main, the subform f_Pending_sf. Your suggesting that I change the name (not the source object) to something else like f_Pending_sf_ctrl. So then the syntax would read... Forms!f_Main!f_Pending_sf_ctrl.Form.Requery Just tried it. IT WORKS! THANK YOU! So.... Yes, I'm one of those ... with another dbase, similar but different situation. If I wanted to requery not the whole subform but a combo box for a particular record, I would replace .Form. with the name of the specific control? Forms!f_Main!f_Pending_sf_ctrl.cmb_box_name.Requer y ~Lori "Klatuu" wrote: I would use the Unload event of the detail form. The correct syntax is: Forms!FormName!SubFormControlName.Form.Requery Note: SubFormControlName is the name of the subform control on the main form. It is not the name of the form being used in the subform control. Access will, be default, name them the same, but IMHO, they should not have the same name. -- Dave Hargis, Microsoft Access MVP "Lori" wrote: I have a main form (no data source) that I use to hold objects for navigation (QBF fields & buttons, Report form buttons...) On the this form I placed a subform (PendingCalls) based on query to give show the basics of pending calls only, on that subform is a button that launches a seperate form PendingCallDetail. When I click the Close button on PendingCallDetail, I would like the form to close and update the subform on the main page. I've been playing with requery for weeks, trying some of the suggestions but nothing seems to work. I've tried both macro and code. How do I refer to the Subform of one form from third form? I keep messages about control not existing. Lori |
#4
|
|||
|
|||
Requery Subform
-- Dave Hargis, Microsoft Access MVP "Lori" wrote: Dave~ See this is where I keep getting messed up after reveiwing the posts here. I called the main form: f_Main, the subform f_Pending_sf. Your suggesting that I change the name (not the source object) to something else like f_Pending_sf_ctrl. So then the syntax would read... Forms!f_Main!f_Pending_sf_ctrl.Form.Requery Just tried it. IT WORKS! THANK YOU! So.... Yes, I'm one of those ... with another dbase, similar but different situation. If I wanted to requery not the whole subform but a combo box for a particular record, I would replace .Form. with the name of the specific control? Forms!f_Main!f_Pending_sf_ctrl.cmb_box_name.Requer y No. The Form property of the subform control has to be used anytime you are referring to anything on the subform. The subform control is NOT a form. It is a control on you main form, just like any other control. One of its properties is Source Object. This property identifies the name of the form to attach as the subform. Therefore, you have to include the Form property if you are addressing anything on the form that is the subform. ~Lori "Klatuu" wrote: I would use the Unload event of the detail form. The correct syntax is: Forms!FormName!SubFormControlName.Form.Requery Note: SubFormControlName is the name of the subform control on the main form. It is not the name of the form being used in the subform control. Access will, be default, name them the same, but IMHO, they should not have the same name. -- Dave Hargis, Microsoft Access MVP "Lori" wrote: I have a main form (no data source) that I use to hold objects for navigation (QBF fields & buttons, Report form buttons...) On the this form I placed a subform (PendingCalls) based on query to give show the basics of pending calls only, on that subform is a button that launches a seperate form PendingCallDetail. When I click the Close button on PendingCallDetail, I would like the form to close and update the subform on the main page. I've been playing with requery for weeks, trying some of the suggestions but nothing seems to work. I've tried both macro and code. How do I refer to the Subform of one form from third form? I keep messages about control not existing. Lori |
#5
|
|||
|
|||
Requery Subform
Dave~
Thanks for the help. I'm closing forms right and left now. ~Lori "Klatuu" wrote: -- Dave Hargis, Microsoft Access MVP "Lori" wrote: Dave~ See this is where I keep getting messed up after reveiwing the posts here. I called the main form: f_Main, the subform f_Pending_sf. Your suggesting that I change the name (not the source object) to something else like f_Pending_sf_ctrl. So then the syntax would read... Forms!f_Main!f_Pending_sf_ctrl.Form.Requery Just tried it. IT WORKS! THANK YOU! So.... Yes, I'm one of those ... with another dbase, similar but different situation. If I wanted to requery not the whole subform but a combo box for a particular record, I would replace .Form. with the name of the specific control? Forms!f_Main!f_Pending_sf_ctrl.cmb_box_name.Requer y No. The Form property of the subform control has to be used anytime you are referring to anything on the subform. The subform control is NOT a form. It is a control on you main form, just like any other control. One of its properties is Source Object. This property identifies the name of the form to attach as the subform. Therefore, you have to include the Form property if you are addressing anything on the form that is the subform. ~Lori "Klatuu" wrote: I would use the Unload event of the detail form. The correct syntax is: Forms!FormName!SubFormControlName.Form.Requery Note: SubFormControlName is the name of the subform control on the main form. It is not the name of the form being used in the subform control. Access will, be default, name them the same, but IMHO, they should not have the same name. -- Dave Hargis, Microsoft Access MVP "Lori" wrote: I have a main form (no data source) that I use to hold objects for navigation (QBF fields & buttons, Report form buttons...) On the this form I placed a subform (PendingCalls) based on query to give show the basics of pending calls only, on that subform is a button that launches a seperate form PendingCallDetail. When I click the Close button on PendingCallDetail, I would like the form to close and update the subform on the main page. I've been playing with requery for weeks, trying some of the suggestions but nothing seems to work. I've tried both macro and code. How do I refer to the Subform of one form from third form? I keep messages about control not existing. Lori |
Thread Tools | |
Display Modes | |
|
|