requery sibling subform

I

Ian

I know this has been asked a million times but I can get the code to work.
I have a main form [Main] with a sub that has checkboxes in it [check] to
update a datasheet form
  • based on a query that involves the checkboxes.

    When a box is turned on or off in the sub [check] I want the
    • to
      update. Have tried various things. I'm assuming I should have something
      like:

      Me.Parent!
      • .Requery in the AfterUpdate control of the actual checkbox
        itself. I don't get an error but nothing happens.

        help please.
 
K

Klatuu

A couple of things.
First, you don't use the name of the subform, you use the name of the
subform control on the main form. It is possible they are the same, but
really should not be.

Second, you are missing one item in your requery. You need to reference the
form object of the subform control:
Me.Parent!
  • .Form..Requery
 
I

Ian

thanks -- worked like a charm -- working now but only after I leave the check
box field. Where do I put the statement so that when one of the checkboxes
is altered it updates the list?
I've tried all of the event controls in the check box field -- should I
attach it to the subform somewhere?

Klatuu said:
A couple of things.
First, you don't use the name of the subform, you use the name of the
subform control on the main form. It is possible they are the same, but
really should not be.

Second, you are missing one item in your requery. You need to reference the
form object of the subform control:
Me.Parent!
  • .Form..Requery
    --
    Dave Hargis, Microsoft Access MVP


    Ian said:
    I know this has been asked a million times but I can get the code to work.
    I have a main form [Main] with a sub that has checkboxes in it [check] to
    update a datasheet form
    • based on a query that involves the checkboxes.

      When a box is turned on or off in the sub [check] I want the
      • to
        update. Have tried various things. I'm assuming I should have something
        like:

        Me.Parent!
        • .Requery in the AfterUpdate control of the actual checkbox
          itself. I don't get an error but nothing happens.

          help please.
 
K

Klatuu

You can use the After Update event of the check box.
--
Dave Hargis, Microsoft Access MVP


Ian said:
thanks -- worked like a charm -- working now but only after I leave the check
box field. Where do I put the statement so that when one of the checkboxes
is altered it updates the list?
I've tried all of the event controls in the check box field -- should I
attach it to the subform somewhere?

Klatuu said:
A couple of things.
First, you don't use the name of the subform, you use the name of the
subform control on the main form. It is possible they are the same, but
really should not be.

Second, you are missing one item in your requery. You need to reference the
form object of the subform control:
Me.Parent!
  • .Form..Requery
    --
    Dave Hargis, Microsoft Access MVP


    Ian said:
    I know this has been asked a million times but I can get the code to work.
    I have a main form [Main] with a sub that has checkboxes in it [check] to
    update a datasheet form
    • based on a query that involves the checkboxes.

      When a box is turned on or off in the sub [check] I want the
      • to
        update. Have tried various things. I'm assuming I should have something
        like:

        Me.Parent!
        • .Requery in the AfterUpdate control of the actual checkbox
          itself. I don't get an error but nothing happens.

          help please.
 
I

Ian

still not updating until I move a away from the indiviual field. I've tried
that command in almost every event field of the check box. Any more
suggestions? Is there a way to program the form to move the focus once box
is checked?


Klatuu said:
You can use the After Update event of the check box.
--
Dave Hargis, Microsoft Access MVP


Ian said:
thanks -- worked like a charm -- working now but only after I leave the check
box field. Where do I put the statement so that when one of the checkboxes
is altered it updates the list?
I've tried all of the event controls in the check box field -- should I
attach it to the subform somewhere?

Klatuu said:
A couple of things.
First, you don't use the name of the subform, you use the name of the
subform control on the main form. It is possible they are the same, but
really should not be.

Second, you are missing one item in your requery. You need to reference the
form object of the subform control:
Me.Parent!
  • .Form..Requery
    --
    Dave Hargis, Microsoft Access MVP


    :

    I know this has been asked a million times but I can get the code to work.
    I have a main form [Main] with a sub that has checkboxes in it [check] to
    update a datasheet form
    • based on a query that involves the checkboxes.

      When a box is turned on or off in the sub [check] I want the
      • to
        update. Have tried various things. I'm assuming I should have something
        like:

        Me.Parent!
        • .Requery in the AfterUpdate control of the actual checkbox
          itself. I don't get an error but nothing happens.

          help please.
 
K

Klatuu

Yes, you can use the SetFocus method.

--
Dave Hargis, Microsoft Access MVP


Ian said:
still not updating until I move a away from the indiviual field. I've tried
that command in almost every event field of the check box. Any more
suggestions? Is there a way to program the form to move the focus once box
is checked?


Klatuu said:
You can use the After Update event of the check box.
--
Dave Hargis, Microsoft Access MVP


Ian said:
thanks -- worked like a charm -- working now but only after I leave the check
box field. Where do I put the statement so that when one of the checkboxes
is altered it updates the list?
I've tried all of the event controls in the check box field -- should I
attach it to the subform somewhere?

:

A couple of things.
First, you don't use the name of the subform, you use the name of the
subform control on the main form. It is possible they are the same, but
really should not be.

Second, you are missing one item in your requery. You need to reference the
form object of the subform control:
Me.Parent!
  • .Form..Requery
    --
    Dave Hargis, Microsoft Access MVP


    :

    I know this has been asked a million times but I can get the code to work.
    I have a main form [Main] with a sub that has checkboxes in it [check] to
    update a datasheet form
    • based on a query that involves the checkboxes.

      When a box is turned on or off in the sub [check] I want the
      • to
        update. Have tried various things. I'm assuming I should have something
        like:

        Me.Parent!
        • .Requery in the AfterUpdate control of the actual checkbox
          itself. I don't get an error but nothing happens.

          help please.
 
I

Ian

Dave you rock! Thanks so much. I just added a control on the main form to
setfocus after the requery request and it instantly changes it. Thanks.


Klatuu said:
Yes, you can use the SetFocus method.

--
Dave Hargis, Microsoft Access MVP


Ian said:
still not updating until I move a away from the indiviual field. I've tried
that command in almost every event field of the check box. Any more
suggestions? Is there a way to program the form to move the focus once box
is checked?


Klatuu said:
You can use the After Update event of the check box.
--
Dave Hargis, Microsoft Access MVP


:

thanks -- worked like a charm -- working now but only after I leave the check
box field. Where do I put the statement so that when one of the checkboxes
is altered it updates the list?
I've tried all of the event controls in the check box field -- should I
attach it to the subform somewhere?

:

A couple of things.
First, you don't use the name of the subform, you use the name of the
subform control on the main form. It is possible they are the same, but
really should not be.

Second, you are missing one item in your requery. You need to reference the
form object of the subform control:
Me.Parent!
  • .Form..Requery
    --
    Dave Hargis, Microsoft Access MVP


    :

    I know this has been asked a million times but I can get the code to work.
    I have a main form [Main] with a sub that has checkboxes in it [check] to
    update a datasheet form
    • based on a query that involves the checkboxes.

      When a box is turned on or off in the sub [check] I want the
      • to
        update. Have tried various things. I'm assuming I should have something
        like:

        Me.Parent!
        • .Requery in the AfterUpdate control of the actual checkbox
          itself. I don't get an error but nothing happens.

          help please.
 
K

Klatuu

Good, Glad I could help
--
Dave Hargis, Microsoft Access MVP


Ian said:
Dave you rock! Thanks so much. I just added a control on the main form to
setfocus after the requery request and it instantly changes it. Thanks.


Klatuu said:
Yes, you can use the SetFocus method.

--
Dave Hargis, Microsoft Access MVP


Ian said:
still not updating until I move a away from the indiviual field. I've tried
that command in almost every event field of the check box. Any more
suggestions? Is there a way to program the form to move the focus once box
is checked?


:

You can use the After Update event of the check box.
--
Dave Hargis, Microsoft Access MVP


:

thanks -- worked like a charm -- working now but only after I leave the check
box field. Where do I put the statement so that when one of the checkboxes
is altered it updates the list?
I've tried all of the event controls in the check box field -- should I
attach it to the subform somewhere?

:

A couple of things.
First, you don't use the name of the subform, you use the name of the
subform control on the main form. It is possible they are the same, but
really should not be.

Second, you are missing one item in your requery. You need to reference the
form object of the subform control:
Me.Parent!
  • .Form..Requery
    --
    Dave Hargis, Microsoft Access MVP


    :

    I know this has been asked a million times but I can get the code to work.
    I have a main form [Main] with a sub that has checkboxes in it [check] to
    update a datasheet form
    • based on a query that involves the checkboxes.

      When a box is turned on or off in the sub [check] I want the
      • to
        update. Have tried various things. I'm assuming I should have something
        like:

        Me.Parent!
        • .Requery in the AfterUpdate control of the actual checkbox
          itself. I don't get an error but nothing happens.

          help please.
 
Top