Requery Subform

  • Thread starter Thread starter Chuck
  • Start date Start date
C

Chuck

I have a subform designed to outline records of various customer service
issues. Each record is a seperate issue. The main form is entitled
"Business" and the subform is entitled "Service Notes List". The idea is to
have a quick reference to past notes and to be able to double click on a
record and view/edit past notes. When I add a service note record I use
another form entitled "Service Note Details". This form is accessed from the
Business form via a command button. My problem is that after a new record is
created on the Service Note Details form and that form is closed (leaving
the Service Notes List subform as the active form) the subform will not
automatically show the new record. I would like to use the requery action
within a macro to force the subform to show the new record as soon as it
receives the focus again. I have tried to creat a macro in the "On Got
Focus" property of the Business form in the following way:
Requery - Forms!Business![Service Notes List].form
however this is not working.
 
Is "Service Notes List" the actual name of the subform control (the control
that actually holds the subform object) on the main form? If not, replace
this name with the actual name of the subform control (open the main form in
design view, click on the subform control's top edge, click on Properties
icon on toolbar, click on Other tab, and see what the Name property is).
 
Yes the name or the subform control is Service Notes List. Thank you.

Ken Snell (MVP) said:
Is "Service Notes List" the actual name of the subform control (the control
that actually holds the subform object) on the main form? If not, replace
this name with the actual name of the subform control (open the main form in
design view, click on the subform control's top edge, click on Properties
icon on toolbar, click on Other tab, and see what the Name property is).

--

Ken Snell
<MS ACCESS MVP>


Chuck said:
I have a subform designed to outline records of various customer service
issues. Each record is a seperate issue. The main form is entitled
"Business" and the subform is entitled "Service Notes List". The idea is
to
have a quick reference to past notes and to be able to double click on a
record and view/edit past notes. When I add a service note record I use
another form entitled "Service Note Details". This form is accessed from
the
Business form via a command button. My problem is that after a new record
is
created on the Service Note Details form and that form is closed (leaving
the Service Notes List subform as the active form) the subform will not
automatically show the new record. I would like to use the requery action
within a macro to force the subform to show the new record as soon as it
receives the focus again. I have tried to creat a macro in the "On Got
Focus" property of the Business form in the following way:
Requery - Forms!Business![Service Notes List].form
however this is not working.
 
You're using the Form's OnGotFocus property to run the macro? A form will
not receive the focus unless no control on the form can receive the focus.

Move your macro to either the Form's OnCurrent property, or to a control's
OnGotFocus property (this control needs to be the one that will get the
focus when you "go" to the form). Or you might be able to use the Form's
OnActivate property, but I wouldn't recommend it because it will tend to
"fire" at unexpected times.

If these don't work, then describe for us in more details the steps/process
that occurs in order for you to "move" to that form.

--

Ken Snell
<MS ACCESS MVP>


Chuck said:
Yes the name or the subform control is Service Notes List. Thank you.

Ken Snell (MVP) said:
Is "Service Notes List" the actual name of the subform control (the
control
that actually holds the subform object) on the main form? If not, replace
this name with the actual name of the subform control (open the main form
in
design view, click on the subform control's top edge, click on Properties
icon on toolbar, click on Other tab, and see what the Name property is).

--

Ken Snell
<MS ACCESS MVP>


Chuck said:
I have a subform designed to outline records of various customer service
issues. Each record is a seperate issue. The main form is entitled
"Business" and the subform is entitled "Service Notes List". The idea
is
to
have a quick reference to past notes and to be able to double click on
a
record and view/edit past notes. When I add a service note record I
use
another form entitled "Service Note Details". This form is accessed
from
the
Business form via a command button. My problem is that after a new
record
is
created on the Service Note Details form and that form is closed
(leaving
the Service Notes List subform as the active form) the subform will not
automatically show the new record. I would like to use the requery
action
within a macro to force the subform to show the new record as soon as
it
receives the focus again. I have tried to creat a macro in the "On Got
Focus" property of the Business form in the following way:
Requery - Forms!Business![Service Notes List].form
however this is not working.
 
I see what you mean. I will try this in the future. I overcame the issue by
running the RunCommand Action with the Argument: Refresh. I put this Macro
You're using the Form's OnGotFocus property to run the macro? A form will
not receive the focus unless no control on the form can receive the focus.

Move your macro to either the Form's OnCurrent property, or to a control's
OnGotFocus property (this control needs to be the one that will get the
focus when you "go" to the form). Or you might be able to use the Form's
OnActivate property, but I wouldn't recommend it because it will tend to
"fire" at unexpected times.

If these don't work, then describe for us in more details the steps/process
that occurs in order for you to "move" to that form.

--

Ken Snell
<MS ACCESS MVP>


Chuck said:
Yes the name or the subform control is Service Notes List. Thank you.

Ken Snell (MVP) said:
Is "Service Notes List" the actual name of the subform control (the
control
that actually holds the subform object) on the main form? If not, replace
this name with the actual name of the subform control (open the main form
in
design view, click on the subform control's top edge, click on Properties
icon on toolbar, click on Other tab, and see what the Name property is).

--

Ken Snell
<MS ACCESS MVP>


I have a subform designed to outline records of various customer service
issues. Each record is a seperate issue. The main form is entitled
"Business" and the subform is entitled "Service Notes List". The idea
is
to
have a quick reference to past notes and to be able to double click on
a
record and view/edit past notes. When I add a service note record I
use
another form entitled "Service Note Details". This form is accessed
from
the
Business form via a command button. My problem is that after a new
record
is
created on the Service Note Details form and that form is closed
(leaving
the Service Notes List subform as the active form) the subform will not
automatically show the new record. I would like to use the requery
action
within a macro to force the subform to show the new record as soon as
it
receives the focus again. I have tried to creat a macro in the "On Got
Focus" property of the Business form in the following way:
Requery - Forms!Business![Service Notes List].form
however this is not working.
 
Back
Top