Results 1 to 3 of 3
  1. #1
    LonghronJ is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    150

    Requery a form based on a variable form name

    I can requery a form by it's actual name, say the name of the form is MyFormName, with the following code
    Code:
    Forms!MyFormName.Form.Requery
    What if MyFormName is stored as a variable, called strMyFormName?


    Code:
    Forms!strMyFormName.Form.Requery
    does not work. Any suggestions?

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    you would use

    Forms(strMyFormName).Requery

    note you should not need the second 'form'

  3. #3
    LonghronJ is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    150
    Perfect. Thanks.

    Quote Originally Posted by Ajax View Post
    you would use

    Forms(strMyFormName).Requery

    note you should not need the second 'form'

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

Similar Threads

  1. Requery sub form based on combo box option
    By enginerdUNH in forum Programming
    Replies: 2
    Last Post: 02-26-2018, 04:39 PM
  2. Replies: 7
    Last Post: 07-01-2015, 10:29 AM
  3. Replies: 5
    Last Post: 06-04-2013, 10:12 AM
  4. Replies: 4
    Last Post: 04-20-2013, 10:12 AM
  5. Refering to variable form names inside a variable
    By redpetfran in forum Programming
    Replies: 2
    Last Post: 05-21-2010, 01:39 PM

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