Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2007
    Posts
    18

    Red face Unanswered: Help on FORMS, Parameter Queries & Exports

    I first apologize for my lack of knowledge. I am not knowledgable on ACCESS or SQL.

    I have a query where I need my user to input a start and an end date and then export it to a .csv.

    I know that running it from a FORM or Parrameter Query results in a 'Too few Parameters' message and is something that ACCESS Export Wizard can not handle. If I just hardcode the Between startdate AND enddate criteria, it works fine. Of course this would never do to have my user do this.

    If I can't export a query that was run from FORM input or by a Parameter Query, how can I accomplish what I need to do?

    Any help or quidance is very much appreciated. .

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Try changing the query to a make-table query. Have it run the make-table query (with your date parameters which you can set up so it asks the user the starting/ending date.) Then have it export the newly created table.

    You'll probably need to set up a macro or a few lines of code to automate the whole thing where it first runs the make-table query and then exports the new table.

    Ideal would be you have the StartDate and EndDate fields on a form, the make-table query uses those dates as criteria in it (i.e. Between Forms!MyForm!StartDate and Forms!MyForm!EndDate), have a button which when clicked, checks to make sure the StartDate and EndDate are not null, runs the make-table query, and then exports the newly created table.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Try looking at this example: http://www.dbforums.com/showpost.php...1&postcount=21 (the new version)

    It does exactly what's mentioned above with a few bonus features.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Sep 2007
    Posts
    18

    Smile Thanks for the reply

    Thanks PKstormy

    I had been using the Between Forms!MyForm!StartDate and Forms!MyForm!EndDate) but couldn't get the export to work.

    While waiting for (your) much needed help, I tried a make-table query using my original input form and the export worked but was wondering how I would automate the process.

    I will pursue your idea of the macro to tie it all togehter. If you have any hints on how to do this, I would appreciate it as right now I have no idea. I have a Access 200 book I borrowed last week perhaps that will set me on the right path.

    Thanks again for your help, the 'folks' on this forum have been a great life line and always very gentle with a newbie like me.

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Try the example out in the link above (if the link doesn't work, it's in the code bank.) Again, look at the new version. Take from the code what you need or tweak it to work for your situation.

    Let me know if it works for you and helps.
    Last edited by pkstormy; 10-30-07 at 18:28.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •