By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

me.refresh issue (reprise)

P: n/a
HI again:

I have made 2 posts on this issue, and for some reason still haven't got the right result.

I have a form which contains a number of totals. These totals use unbound control boxes
and are of the form: =Dcount("field","table"). The form contains a number of buttons which
trigger queries (using a macro) that update some tables and delete records from others.
The effect of these macros is to change the counts that should register in the =dcount
fields.

HOWEVER -- when the buttons are pressed, the queries executed and the records moved
around, the totals remain as they were before the buttons were pressed.

I first tried changing from macros to code. The code looks like this:
Private Sub Command1_Click()
Run ("committimseheets")
Me.Refresh

End Sub

This routine ended up with ONLY the form in question active -- all other forms and such
like are closed in the macro. Hence, I would think that the me.Refresh would focus on the
form I am interested in. Still there is NO refreshing!

I have a button (just to test things out) on the form which executes a single line of
code: "me.refresh", and that works fine, but it doesn't do anything else,

Can someone suggest what I am doing wrong. It apepars that somehow the macro and the
"Me.Refresh" are not working in total harmony.

I apologize for reurning to this group with the same basic problem a number of times, but
somehow the nature of the problem appears to change with each answer I get.

Regards

John Baker
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Try me.requery.
That will update the recordset, not just the calculations.
Note that this will move the user to the starting record, so you may want to make a note of the current record, and move them back there afterwards.

Regards,

Fraser.

John Baker <Ba******@Verizon.net> wrote:
HI again:

I have made 2 posts on this issue, and for some reason still haven't got the right result.

I have a form which contains a number of totals. These totals use unbound control boxes
and are of the form: =Dcount("field","table"). The form contains a number of buttons which
trigger queries (using a macro) that update some tables and delete records from others.
The effect of these macros is to change the counts that should register in the =dcount
fields.

HOWEVER -- when the buttons are pressed, the queries executed and the records moved
around, the totals remain as they were before the buttons were pressed.

I first tried changing from macros to code. The code looks like this:
Private Sub Command1_Click()
Run ("committimseheets")
Me.Refresh

End Sub

This routine ended up with ONLY the form in question active -- all other forms and such
like are closed in the macro. Hence, I would think that the me.Refresh would focus on the
form I am interested in. Still there is NO refreshing!

I have a button (just to test things out) on the form which executes a single line of
code: "me.refresh", and that works fine, but it doesn't do anything else,

Can someone suggest what I am doing wrong. It apepars that somehow the macro and the
"Me.Refresh" are not working in total harmony.

I apologize for reurning to this group with the same basic problem a number of times, but
somehow the nature of the problem appears to change with each answer I get.

Regards

John Baker


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.