Help with DoMenuItem

S

Steve

I've got a database that was converted from 95 to 97.
it has a form with many subforms on it.
The subforms hold data from numerous queries based on
parameters entered.
The code to refresh the data is
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
I'm assumming that the 5 is for refresh but can't find the
list of 95 commands to verify this.
I've converted the queries to oracle passthrus. I can get
the passthrus updated with new parameter info but it seems
that the above code fails to refresh the data in the forms.
I need to close the form to get the passthrus to refresh.
Is there a better way to rewrite the refresh procedure
that will allow the "modified" passthrus to repopulate the
subforms without having to close them?
 
A

Albert D. Kallal

I would as a rule avoid any menu item call....

For a form, to re-load the query..you use

me.Requery

And, if you have a sub-form...then simply execute the requery on the
sub-form like:

me.MySubFrom.Form.Requery

Just replace "mysubform" with whatever you gave the name of the sub-form
control (note that a sub-form is not really a sub-form..but only a
control...and thus you the "form" property to get at the form.....
 
G

Guest

It didn't work.
I have a form named TER1 with a tabcontrol containing
8 "pages", each with its own subform on it.
On one of these pages is the subform MSummary.
In the Refresh button (on the TER1 form), I coded
Me.MSummary.Requery
The passthru for this query is created in a function
because it uses parameters stored in Access to query an
Oracle Database. The above code did update the passthru
query however it didn't rerun the query to update the
dataset. Could the fact that it is a passthru and not an
Access query be the reason why?
(I also ran
Me.TER_Multi_Emplno_Summary_Subform.Requery with no better
results. This is the name of the subform on MSummary)
 
A

Albert D. Kallal

It didn't work.
I have a form named TER1 with a tabcontrol containing
8 "pages", each with its own subform on it.
On one of these pages is the subform MSummary.
In the Refresh button (on the TER1 form), I coded
Me.MSummary.Requery

The format is NOT what I poseted.....try:

me.MSummary.Form.Requery

So, to use any of the (sub) forms events/mehtoeds..you use the ".form"
properity of the sub-form contorl....
 

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

converting DoMenuItem to RunCommand 1
Refresh command question 3
Date on Report 1
Refresh Data Button Command 2
Access 1
'#deleted' problem... 1
combine codes 5
refresh problem 2

Top