refresh all

marco_c

New member
Local time
Today, 07:01
Joined
Apr 16, 2011
Messages
2
hello everybody!
i'm using ms office 2007 and i'd like to create a button on the form called "prevention" who can "refresh all" (updated for multiple users)

basically like in the ribbon menu

i created a button and in the code i wrote:

Option Compare Database

Private Sub Command15_Click()

Forms!Form_prevention.Requery

End Sub


but it doesn't work. any idea?

i heard even that it is possible to reduce the time between refreshes, use the menu bar, Tools->Options->Advanced to
set the Refresh Interval (secs): property to a lower value, at the
expense of slowing down the application.

what do you suggest?

thanks to all your replies
marco
 
You need to be clear here about exactly what you're trying to accomplish. Refresh and Requery are not the same thing!

From Access Help:

In an Access database (.mdb), Refreshing records only updates the data that already exists in your datasheet or form. It doesn't reorder records, display new records, or remove deleted records and records that no longer meet specified criteria. To perform those tasks, Requery the records.

You should also note that by itself, Requering will take a form back to the first record in its Record Source. You can write code to 'bookmark' the current record and return to it after a Requery, but that's in addition to actual Requering.

And yes, you can adjust the frequency with which Access automatically refreshes records, the Options.

Also, Refresh or Requery only effects the form which calls it, i.e. you doing this on the form you're using does not make the form other users have open Refresh or Requery.

Linq ;0)>
 
hello missinglinq!
thanks for your reply :)
yes i need a button for refresh all in a
access database .accdb
i was wrong about requery, i don't need it

how can i add a button in the form with the same function as "refresh all" in the ribbon menu?
many thanks
 
...yes i need a button for refresh all...
I don't run 2007, and 'Refresh All' is not available in previous versions, but by Googling 'refreshall' and 'Access 2007' it appears that what this does, in point of fact, is to 'requery' rather than 'refresh' in the sense that it was used in previous versions of Access.

As I said in my original response, I think we need to know exactly what you think/expect to happen when 'refreshing all.'

Naming conventions used by the Access development team are noted for not necessarily meaning what a person with common sense would expect them to do.

If your intention is for the data that all of the multiple users are viewing to be 'up to date' I think you're in for disappointment. I could be wrong but I suspect that it is only going to update the data being viewd by the user who triggers the event.

I could be wrong and hopefully someone who runs versions 2007/2010 will wander by and elucidate us!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom