REQUERY SUBFORM

D

-debi-

Good Day,

Main Form [frmDATE]
Sub Form [frmCOUNT]


On the subform ON Enter, I have DoCmd.Requery, which works fine after I
click on the subform.

When I try to requey the subform from the mainform using a Macro Requery
[forms]![frmCOUNT], it says it's either not in the current form or it can't
find that form name.

I have combo boxes in my subform that work fine for entering data, but if I
just want to go record by record from the main form, the sub form doesn't
show the proper data unless I click on it to use the requery in the ON Enter.

Please help. Thank you! -debi-
 
B

boblarson

To requery a subform you have to reference the CONTROL that houses the
subform on the main form. And, you have to use .Form. to tell Access you
want the property, or method, of the subform and not the subform container.

Me.YourSubformContainerControlName.Form.Requery


--
Bob Larson
Access World Forums Super Moderator

Tutorials at http://www.btabdevelopment.com

__________________________________
 
D

-debi-

Hi Bob, I'll give it a try. I've read most of the "post" on this and for
some reason just can't get it. I haven't tried the .Form.

Thank you very much for you response. -debi-

boblarson said:
To requery a subform you have to reference the CONTROL that houses the
subform on the main form. And, you have to use .Form. to tell Access you
want the property, or method, of the subform and not the subform container.

Me.YourSubformContainerControlName.Form.Requery


--
Bob Larson
Access World Forums Super Moderator

Tutorials at http://www.btabdevelopment.com

__________________________________


-debi- said:
Good Day,

Main Form [frmDATE]
Sub Form [frmCOUNT]


On the subform ON Enter, I have DoCmd.Requery, which works fine after I
click on the subform.

When I try to requey the subform from the mainform using a Macro Requery
[forms]![frmCOUNT], it says it's either not in the current form or it can't
find that form name.

I have combo boxes in my subform that work fine for entering data, but if I
just want to go record by record from the main form, the sub form doesn't
show the proper data unless I click on it to use the requery in the ON Enter.

Please help. Thank you! -debi-
 
B

boblarson

debi:

In Me.YourSubformContainerControlName.Form.Requery

The .Form. part tells Access that you are wanting a property, or method, of
the form within the subform container control. So, you should be able to
take the code I gave you and replace the YourSubformContainerControlName with
the actual name of the subform container on the main form and don't change
anything else from what was written.

See here for more about subforms:

http://www.btabdevelopment.com/main...rhowtoreferencesubforms/tabid/76/Default.aspx

http://www.btabdevelopment.com/main...bformsincontrolsources/tabid/106/Default.aspx

--
Bob Larson
Access World Forums Super Moderator

Tutorials at http://www.btabdevelopment.com

__________________________________


-debi- said:
Hi Bob, I'll give it a try. I've read most of the "post" on this and for
some reason just can't get it. I haven't tried the .Form.

Thank you very much for you response. -debi-

boblarson said:
To requery a subform you have to reference the CONTROL that houses the
subform on the main form. And, you have to use .Form. to tell Access you
want the property, or method, of the subform and not the subform container.

Me.YourSubformContainerControlName.Form.Requery


--
Bob Larson
Access World Forums Super Moderator

Tutorials at http://www.btabdevelopment.com

__________________________________


-debi- said:
Good Day,

Main Form [frmDATE]
Sub Form [frmCOUNT]


On the subform ON Enter, I have DoCmd.Requery, which works fine after I
click on the subform.

When I try to requey the subform from the mainform using a Macro Requery
[forms]![frmCOUNT], it says it's either not in the current form or it can't
find that form name.

I have combo boxes in my subform that work fine for entering data, but if I
just want to go record by record from the main form, the sub form doesn't
show the proper data unless I click on it to use the requery in the ON Enter.

Please help. Thank you! -debi-
 
D

-debi-

Hi Bob,

Thank you very much! I checked out your website.......it's great! Thanks
again for your support!!!!!!!!!!!!!!! -debi-

boblarson said:
debi:

In Me.YourSubformContainerControlName.Form.Requery

The .Form. part tells Access that you are wanting a property, or method, of
the form within the subform container control. So, you should be able to
take the code I gave you and replace the YourSubformContainerControlName with
the actual name of the subform container on the main form and don't change
anything else from what was written.

See here for more about subforms:

http://www.btabdevelopment.com/main...rhowtoreferencesubforms/tabid/76/Default.aspx

http://www.btabdevelopment.com/main...bformsincontrolsources/tabid/106/Default.aspx

--
Bob Larson
Access World Forums Super Moderator

Tutorials at http://www.btabdevelopment.com

__________________________________


-debi- said:
Hi Bob, I'll give it a try. I've read most of the "post" on this and for
some reason just can't get it. I haven't tried the .Form.

Thank you very much for you response. -debi-

boblarson said:
To requery a subform you have to reference the CONTROL that houses the
subform on the main form. And, you have to use .Form. to tell Access you
want the property, or method, of the subform and not the subform container.

Me.YourSubformContainerControlName.Form.Requery


--
Bob Larson
Access World Forums Super Moderator

Tutorials at http://www.btabdevelopment.com

__________________________________


:

Good Day,

Main Form [frmDATE]
Sub Form [frmCOUNT]


On the subform ON Enter, I have DoCmd.Requery, which works fine after I
click on the subform.

When I try to requey the subform from the mainform using a Macro Requery
[forms]![frmCOUNT], it says it's either not in the current form or it can't
find that form name.

I have combo boxes in my subform that work fine for entering data, but if I
just want to go record by record from the main form, the sub form doesn't
show the proper data unless I click on it to use the requery in the ON Enter.

Please help. Thank you! -debi-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top