Results 1 to 2 of 2
  1. #1
    msuguy71 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    10

    Question Date Range form issues

    Hi all,



    I have a problem, and I am not sure how to address it. Here are the issues:

    I wanted to create one form for entering a date range (start & end dates) for any reports that I would need a date range. I created a date range form using unbound textboxes. I read that the date range form had to remain open so that the dates could be passed to the report. So, to address this I have my report open the date range form on report open, then I created a "run report" button and a "cancel" button on the date range form. On the run report button I created a macro (using the macro builder) to open the report, and then close the date range form.

    Here is the problem. I have to create a new date range form for every report I want to search based on a date range because of how the macro builder selects the report to open (it doesn't know that I ran a specific report).

    Another problem is that I created a second report which was similar to my first one but the query is different because I was getting an error, but on that report, I can't pass the start and end date parameters (using the update parameters in the macro builder) like I could with my first report. So, when I run the second report, the date range form opens, I enter my dates, hit run report, the date range form closes and the generic parameter box appears wanting me to enter a date. Everything is the same except I can't pass the parameters because that section doesn't open on the macro builder.

    I know that what I am trying to do is not proper database building with regard to the date range forms issue. Anyone able to help me out?

    I included my database in this post.

    Thanks,

    Rick
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    For starters, recommend not using dynamic parameters in query (I never do). Instead use the WHERE condition of OpenReport.

    The report name can be passed to the date range form with OpenArgs argument of OpenForm. Then code in date range form can read its OpenArgs to extract the report name to 'know' what report you want.

    I use only VBA and this is all very easy in VBA. Not sure about macro.
    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. Creating a Date Range Form
    By daniejm in forum Forms
    Replies: 1
    Last Post: 12-13-2012, 08:51 AM
  2. Date Range on Form
    By normie in forum Access
    Replies: 16
    Last Post: 03-13-2012, 08:57 PM
  3. date range form values as parameters
    By cfnieder in forum Forms
    Replies: 8
    Last Post: 08-11-2010, 01:48 PM
  4. Date range query from form
    By Steve Barnes in forum Queries
    Replies: 2
    Last Post: 07-29-2010, 07:06 PM
  5. Search form with a date range
    By mantro174 in forum Forms
    Replies: 1
    Last Post: 02-11-2009, 10:45 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