Command for "Refresh All" like in access Home Tab Ribbon, but not only Refresh RRS feed

  • Question

  • HI

    I am looking for a command like "Refresh All" in access Ribbon Home Tab. 

    Because my data from a query only appears in the field of a form when I click Refresh All from access Home tab but not with Refresh only.

    I am not that much expert so Please mention the field in which I have to use that command.


    Monday, April 6, 2020 9:25 AM

All replies

  • I've seen

    SendKeys "+({f9})"


    CommandBars.ExecuteMso "DataRefreshAll"

    offered as the only way to do this in the past, but I'd be more interested in why you need this in the first place and addressing your underlying structural issue as SendKeys is to be avoided at all cost normally.


    I've also seen code that loops through each form and requeries them, one such thread is

    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support:
    MS Access Tips and Code Samples:

    Monday, April 6, 2020 10:21 AM
  • Thank you very much.

    Answer of Why.

    Form 1 (step1)

    1) I have created a user registration form, containing First Name, Last Name, Password , confirm password

    and then Continue Button on that form

    Form 2 (step2)

    2) This continue button takes the user to another page, which has a field of "User ID" which is generated through query based on the Name of user.

    Problem here is, User ID field remain empty unless I click on "Refresh All" on the access Home Tab Menu, 

    I tried to create a refresh button with "Me.refresh" or "Me.Requery" on that page, So that user can click on that to get hi/her "User ID".

    After that on this form there is button "continue to login" , this will take the user to another form to for Login the system

    Form 3 (step3)

    3) Login System

    Here user user can login with user ID and Password to enter in the system.

    Coming back to my question:

    As above mentioned, at step number 2, "User ID" only appears when I click "Refresh All" from Access Menu bar.

    but not even automatic, when user comes from Step 1 to step 2 by pressing "continue button" after filling registration form.


    This works well very well without any refresh, If I create "User ID" in a subform of Form 1 (Reg. form).

    But only If  keep Form properties "Data Entry = NO"

    As soon as User leaves registration Form1, Then User ID appears super fast, without any refresh.

    Problem:   By keeping "Data Entry=No" then 

    1) registration data keeps on replacing user data in the Query/table,  Meaning new record is save but previous is replaced.

    2nd problem: Registration form stays Filled with the information of last user,  Meaning registration form1 does not get clear.

    By Keeping: "Data Entry=Yes" in Form1 (reg. form) then Registration form has no problem, Data gets clear for new user, and data is entered in Query/Table.

    At this point if my User ID Form 2 (now) is subForm of Form 1, Then it does not work because Property of Form "Data Entry= Yes".

    Thats the Reason I created New Form (Form2) for "User ID"   --- which now does not show without Refresh All.

    Hope I explained.

    Monday, April 6, 2020 12:04 PM
  • One more thing here,

    I am new here, If you recommend any code here, please Tell me little expanded.

    For Example, where to put that code etc

    I learning still.


    Monday, April 6, 2020 12:09 PM
  • I'd be using the Continue button's click event to generate the User ID.

    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support:
    MS Access Tips and Code Samples:

    Monday, April 6, 2020 1:23 PM