refresh a subform

  • Thread starter Thread starter jlute
  • Start date Start date
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!
 
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.
 
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.
 
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.
 
Back
Top