Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Asking for a date parameter to use (2002)

    An easy one I hope <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

    I've got a complex set of queries that result in a file export.
    I've made it all work as I wish but have one last frill

    I wish to prompt for a date at the beginning and then use that same result to drive
    * the first query
    * some other queries (dates within 3 months of that date)
    * naming of the exported file (export yyyymmdd.txt)

    I have a public Variable called MyDate that I can use for everything - but - how do I first ask for it? Inputbox will work, but doesn't have data validity checks, I created a form but it seems to give me grief because I don't know how to dismiss it properly.

    What I'd really like to do is have an access Macro prompt for date at the beginning, and dismiss the form as soon as the date field is entered. What am I missing?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Asking for a date parameter to use (2002)

    I would use a form with a text box and an OK button. If you set the Format property of the text box to one of the date formats, Access will check for a valid date. The On Click event procedure of the command button will set the public variable, then close the form.

  3. #3
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Asking for a date parameter to use (2002)

    Thanks Hans - that works

  4. #4
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Asking for a date parameter to use (2002)

    I spoke too soon
    It apparently works and looks great. However, I think its triggering a bug in Access. When I eventually close Access I get a total lockup with 100% CPU use and have to kill it.
    I use
    DoCmd.Close acform, "GetDate"
    In the _Click event of the form. (I'm also using ODBC to link into the back end of a FoxPro database for the queries)

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Asking for a date parameter to use (2002)

    I don't know what causes the lockup, but I very much doubt that it's the opening and closing of the date parameter form. I use forms like that in many of my databases, and they are used day in day out by multiple users without problems.

    I see that you use the On Click event of the form itself instead of that of a command button, but that shouldn't matter either.

    Without knowing more about the database, it's impossible to guess the cause of your problem.

Posting Permissions

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