Results 1 to 4 of 4
  1. #1
    Reaper is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Posts
    57

    Can I open a form using a string variable for the "formname" argument??

    Can I open a form using a string variable for the "formname" argument??



    I have one form that could be opened from at least three different other forms. I'd like to pass the name of the parent form to it so that I can return to that form when it's closed.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sure:

    DoCmd.OpenForm VariableName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Reaper is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Posts
    57
    Quote Originally Posted by pbaldy View Post
    Sure:

    DoCmd.OpenForm VariableName
    Ok, I got it working. I had zigged instead of zagged. It helps to have the variable definition in the right spot.

    Thanks.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad you got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 01-15-2014, 07:57 PM
  2. Replies: 5
    Last Post: 06-26-2013, 02:29 PM
  3. Replies: 4
    Last Post: 06-24-2013, 07:12 AM
  4. table field name "Year" causing Argument Not Optional
    By JosmithTwo in forum Programming
    Replies: 2
    Last Post: 09-26-2012, 08:01 PM
  5. Replies: 3
    Last Post: 10-20-2009, 06:56 AM

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