Results 1 to 4 of 4
  1. #1
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125

    close form based on string

    I'm using this for a back button, I have some code that sets a string during a form's Current event to the form name.

    On the click of the back button I'm trying to run:

    Code:
    DoCmd.Close acForm, " & strCurrentPage & "
    however this just gets me (printout in debug):

    Code:
    DoCmd.Close acForm, frmAllProj
    when I need:

    DoCmd.Close acForm, "frmAllProj"



    Any suggestions on how to get those quotations in there? Is it just some syntax that i'm messing up? Thanks.

  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,652
    This works for me:

    DoCmd.Close acForm, strCurrentPage
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125
    So it does...it appears my absentmindedness has struck again.

    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,652
    No problemo.
    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. Can not close pop up form after second pop was opened
    By snoopy2003 in forum Programming
    Replies: 2
    Last Post: 03-09-2011, 02:56 AM
  2. How to refresh and close a form
    By LAazsx in forum Forms
    Replies: 10
    Last Post: 12-13-2010, 06:24 AM
  3. form won't save and close
    By Philislost in forum Access
    Replies: 6
    Last Post: 10-08-2010, 01:47 PM
  4. Close All but One Form
    By Bruce in forum Forms
    Replies: 4
    Last Post: 04-06-2010, 09:31 AM
  5. close form
    By taylorosso in forum Forms
    Replies: 5
    Last Post: 08-25-2009, 12:18 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