Results 1 to 3 of 3
  1. #1
    jpkeller55 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    169

    Use form control value as parameter for query

    I have a pop up form that is run by a query that needs to grab the parameter value from a field on the open form. It grabs the value for "QuestIDfrm" from the form "frmQuestionDetail" using the statement below pasted into the query parameter

    Code:
    [Forms]![frmQuestionDetail]![QuestIDfrm]
    This works fine when I call the pop up from the form "frmQuestionDetail". What if I want to call this same pop up form from another form that has the same control (QuestIDfrm).



    Is there a generic syntax that would grab QuestIDfrm from the current open form? Something like
    Code:
     [Forms]![CurrentOpenForm]![QuestIDfrm]

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    I don't think so from an Access query parameter. VBA code can refer to 'ActiveForm', however, the active form would be the popup.

    I pass the calling form name to the popup with OpenArgs argument. Example:

    DoCmd.OpenForm "AddEditSpecifications", , , , , , Me.Name
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jpkeller55 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    169
    Yep, I figured that was the case but thought I would throw it out there for consideration. Thanks for replying.

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

Similar Threads

  1. Replies: 3
    Last Post: 12-08-2011, 10:52 AM
  2. Re-Usable form/query parameter
    By nostr4d4m in forum Queries
    Replies: 1
    Last Post: 03-16-2011, 10:20 AM
  3. Form with parameter query subform
    By shiphtfour in forum Forms
    Replies: 11
    Last Post: 12-29-2010, 06:43 PM
  4. Pass a Parameter From a form to a Query
    By DDillesha in forum Forms
    Replies: 1
    Last Post: 10-28-2009, 12:49 PM
  5. Report with Parameter Query/Form
    By maggioant in forum Reports
    Replies: 0
    Last Post: 10-09-2009, 09:48 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