Results 1 to 2 of 2
  1. #1
    DASeb is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    2

    Parameter query from last step won't carry forward in macro

    Hi Forum, I'm new here.



    I'm having an issue with the macro I've built.

    The first step pulls data based on a registration date range that needs to be changed monthly. I decided to create a parameter query with two prompts to simplify things.

    The next step in the macro use an If Then Else that looks like this:

    If DCount("*","Step 2")>0 Then
    Message Box "Update Adjudicator Table"
    Stop Query
    Else
    OpenQuery "Step 3"

    My problem is that Step 2 uses Step 1 to make the check, but now requires those two date to be filled in. We do not receive the prompt and this breaks the macro.

    Is there a way to save the inputs from Step 1 to be used in the If Action?

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Basically, no. The user inputs to popups cannot be 'grabbed' by the code.

    Is this a macro or VBA? I use only VBA.

    Why open query? Users normally should not interact with tables and queries, only forms and reports.

    I NEVER use dynamic parameters in queries, especially not popup input prompts.

    I use controls on form for criteria input. Then I use code to reference the controls and pass criteria to form or report.
    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.

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

Similar Threads

  1. Macro Single Step Error
    By cfspartan in forum Macros
    Replies: 6
    Last Post: 04-25-2015, 12:05 AM
  2. Replies: 2
    Last Post: 02-12-2015, 05:14 AM
  3. Northwind Database Tutorial step by step
    By AATQA in forum Access
    Replies: 1
    Last Post: 10-22-2013, 06:20 AM
  4. Replies: 7
    Last Post: 07-12-2013, 01:49 PM
  5. Carry value over to new record w/macro
    By bbrazeau in forum Programming
    Replies: 5
    Last Post: 10-27-2011, 09:00 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