Results 1 to 4 of 4
  1. #1
    Phoenixenv is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Location
    Perth, WA
    Posts
    8

    The command or action 'Refresh' isnt available now

    Hi everyone,
    Im hoping someone can help with something that should be quite simple.

    i have a form, with a subform. On the main form i have 2 combox boxes (Project number and Observer) that i want to use to autofill the same fields in the subform, just to pre-populate those fields when people are entering data manually.

    I have done this before on other forms in the same database and it works great, simply by using a macro: RunMenuItem: Refresh. And setting the default values for each field in the subform to the Combobox value.

    But upon creating this new form/subform i get the following error:

    "The command or action 'Refresh' isnt available now.

    *You may be in a read-only database or an unconverted database from an earlier version of Microsoft Access
    *The type of object the action applies to isnt currently selected or isnt in the active view

    Use only those command and macro actions that are currently available for this database."

    It certainly isnt a read-only or unconverted database. So that leaves me with the second error option, which i dont see how that applies either, as all i am doing is refreshing. If i ignore the error and choose not to stop the macro, and then hit refresh form the Ribbon, then the Project code selected appears in the subform, as required.



    Any suggestions people?

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    What are you refreshing, the subform or the fields in the subform? What is the code in that macro? You can do that also with code instead of macro in the Afterupdate of each combo box. I don't know what is causing those errors, maybe the object you are trying to refresh does not have the focus or something.

  3. #3
    Phoenixenv is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Location
    Perth, WA
    Posts
    8
    Thanks Bulzie, by using the following simply code, rather than the macro, it now works fine:

    Private Sub CboSelectProject_AfterUpdate()
    Me.Refresh
    End Sub

    Private Sub CboSelectRecorder_AfterUpdate()
    Me.Refresh
    End Sub

    It really bugs me when Access does this type of thing. Why would the macro, which is just using the refresh command on the home tab of the ribbon not work (if i manually hit refresh on the ribbon it works), while the VBA code does. So frustrating for a novice (advanced ) like myself.

    Cheers.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Well using VBA is usually better so all is good.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. the command or action zoom 100% isn't available now
    By Gina Maylone in forum Access
    Replies: 5
    Last Post: 05-03-2017, 09:42 PM
  2. Replies: 1
    Last Post: 02-13-2012, 10:43 AM
  3. Changing Action on a Command Button
    By ETCallHome in forum Forms
    Replies: 5
    Last Post: 03-14-2011, 05:53 AM
  4. command or action " isn't available
    By laqsb in forum Access
    Replies: 3
    Last Post: 07-23-2010, 10:29 AM
  5. The command or action Quit isn't available
    By Macallan60 in forum Access
    Replies: 0
    Last Post: 04-26-2010, 09:59 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums