Connecting Tech Pros Worldwide Help | Site Map

me.refresh issue (reprise)

  #1  
Old November 12th, 2005, 07:41 PM
John Baker
Guest
 
Posts: 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
  #2  
Old November 12th, 2005, 07:41 PM
4Fraza
Guest
 
Posts: n/a

re: me.refresh issue (reprise)



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 <Baker.JH@Verizon.net> wrote:[color=blue]
>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[/color]

Closed Thread