• Asking for a date parameter to use (2002)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Asking for a date parameter to use (2002)

    Author
    Topic
    #413322

    An easy one I hope crossfingers

    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?

    Viewing 1 reply thread
    Author
    Replies
    • #910841

      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.

      • #910845

        Thanks Hans – that works

      • #910846

        Thanks Hans – that works

      • #910904

        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)

        • #910910

          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.

        • #910911

          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.

      • #910905

        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)

    • #910842

      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.

    Viewing 1 reply thread
    Reply To: Asking for a date parameter to use (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: