Refresh Data in a subform

G

ggerke

Hello All Again,
I hope I can explain this correctly;
I have a main form, on that main form I have a combo box to select criteria
from a table, [cboSelectStore], I then use a tabcontrol to show each
department from the selected store on it's own tab, based on the store
selected in the combo box on the main form. I can click on the department tab
to view that tab which has a subform to show the items from that department.
OK, this works great so far. For each item record I have a Yes/No Toggle box
to select each individual item OR on the main form I added a Toggle button to
select/deselect all the records showing in the subform, and then run an
append query, (linked to the afterupdate property), to toggle all of the item
records on the subform. So far so Good. This is where my problem lies, I
would like to refresh the form data on the subform within the tab control. I
have tried adding a line in the macro which calls the append query, to
RunCommand - Refresh, but I get an error message that "refresh is not
available". I have tried to requery the control but access does not recognize
the name of the subform, (I am assuming because it is embedded in the tab
control).
Is there a way to refresh this data or make reference to the subform within
the tab control???
Thank-you for your time.
 
S

Scott Lichtenberg

Subforms on a tab control behave like any other subform. Click once on the
subform and look in the Other section of the properties box to see its name.
You can then manipulate it with VBA code using the following syntax:

Me!MySubformName.Form.Requery

You need the .Form property to tell Access that you want to go down into the
subform itself, rather than just working with the subform control that is on
your main form.
 

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

Similar Threads

main form/subform 1
refresh/requery subform 2
Refreshing a subform 2
Populate main form from subform record 0
Refresh calling form 7
Referring to control in the active subform 0
refresh a subform 3
subform refresh 7

Top