Consulting

Results 1 to 8 of 8

Thread: Solved: access - calendar to run query

  1. #1
    VBAX Regular
    Joined
    Mar 2005
    Posts
    15
    Location

    Exclamation Solved: access - calendar to run query

    At this stage I'm running my query from a promt entry, this is a date entry.

    I have also a calendar form created

    What I have been tring to do is when the user click on the command button a calendar pops up you then select a date and then from this date the query runs.

    Does any one have any ideas

  2. #2
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    What kind of query is it? If it's an action query you can set the parameter of the query definition and then execute it. If you just want to display data, you're better off having a form that you filter.

  3. #3
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Sounds like he wants THIS, but he wants the results used as the parameter(s) for a query. But I don't know how to do all that.

    LOVE your new title, Geekgirl!!
    ~Anne Troy

  4. #4
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    Can be done, but I just need to know the type of query.

    Hey, do you think this is a case of the blind leading the blind?

  5. #5
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Naw. That's what they call it when it's two GUYS.
    ~Anne Troy

  6. #6
    VBAX Regular
    Joined
    Mar 2005
    Posts
    15
    Location
    What it does is when you click on a cmdButtton a Calendar is supposed to appear. Select / click on a date required then this runs a report which uses a query to obtain data.

    Report Name - [vba]r4540-Newlands Load Table[/vba]

    Query Name - [vba]q4540-NewlandsLd[/vba] This is just the normal paramater query prompting for dates. But instead of the prompts I was hoping to be able to use a Calendar

  7. #7
    Site Admin
    The Princess VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Does the link I provided help you at all?
    ~Anne Troy

  8. #8
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    The process is that when you click the calendar, you update an unbound text field on the form to the value of the calendar object - for example,

    [VBA]
    Me.txtFilterDate = Me.objCal.Value
    [/VBA]

    Instead of having the parameter in the query, you set the criteria of the query to get the date from the text box on your form, so your criteria will be something like Forms!frmRunReport!txtFilterDate.

    Depending on your report, you may actually want 2 dates so that your report can show all data between those dates.

Posting Permissions

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