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  

Requery Subform



 
 
Thread Tools Display Modes
  #1  
Old March 4th, 2008, 04:21 PM posted to microsoft.public.access.forms
Lori
external usenet poster
 
Posts: 673
Default 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  
Old March 4th, 2008, 04:55 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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  
Old March 4th, 2008, 05:21 PM posted to microsoft.public.access.forms
Lori
external usenet poster
 
Posts: 673
Default 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  
Old March 4th, 2008, 05:31 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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  
Old March 6th, 2008, 02:09 PM posted to microsoft.public.access.forms
Lori
external usenet poster
 
Posts: 673
Default 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

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 09:00 PM.


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