refresh a subform

J

jlute

I've been reading through the forum on this topic and haven't found an
answer for my particular design.

I have a subform in datasheet view. It's in the tab control of a main
form. I simply want to place a refresh button on the tab control to
refresh the subform.

Can this be done? If so what code do I need for the button?

Thanks in advance for your help!
 
R

Rick Brandt

I've been reading through the forum on this topic and haven't found an
answer for my particular design.

I have a subform in datasheet view. It's in the tab control of a main
form. I simply want to place a refresh button on the tab control to
refresh the subform.

Can this be done? If so what code do I need for the button?

Thanks in advance for your help!

Me.SubformControlName.Requery

or in some cases you need...

Me.SubformControlName.Form.Requery

Note that there is a difference between Requery and Refresh. I used Requery
because that is what most people would want in such situations. You could
substitute the word Refresh if there is a reason for wanting that particular
command.

I would reference the help file for the differences between the two.
 
S

Stuart McCall

I've been reading through the forum on this topic and haven't found an
answer for my particular design.

I have a subform in datasheet view. It's in the tab control of a main
form. I simply want to place a refresh button on the tab control to
refresh the subform.

Can this be done? If so what code do I need for the button?

Thanks in advance for your help!

Me.SubformControlName.Form.Requery

SubformControlName is the name of the control on your tab control which
contains the subform. Appending .Form to this name means you're then
referring to the form within it.
 
J

jlute

Thanks, Rick and Stuart! That was simple enough!

Me.SubformControlName.Requery

or in some cases you need...

Me.SubformControlName.Form.Requery

Note that there is a difference between Requery and Refresh.  I used Requery
because that is what most people would want in such situations.  You could
substitute the word Refresh if there is a reason for wanting that particular
command.

I would reference the help file for the differences between the two.
 

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