Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

changing a ms access query

Discussion in 'Information Technology' started by nathan, Jul 28, 2006.

  1. nathan

    nathan
    Expand Collapse
    Guest

    i have a form where someone will enter two dates. i want to update the query
    where it searches for records that are in between those dates. then i want to
    export the query to excel on my desktop. i know how to do the second part but
    i can not figure out how to changes the parameters of that field. if anyone
    has any suggestions it would really be a big help. thanks.
     
  2. Loading...

    Similar Threads Forum Date
    S Asia Thinking about the big move: The Sikh way of life changing in Khyber-Pakhtunkhwa Breaking News Mar 22, 2014
    Opinion Haanji's Quick Takes on a Changing World (September 23, 2013) Breaking News Sep 22, 2013
    Changing my last name to Kaur... Questions and Answers May 15, 2013
    Life-changing Inspirational Stories Mar 31, 2013
    USA Sikhism and the Changing Electoral Demographic Breaking News Mar 8, 2013

  3. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    Nathan,

    In the design view of your query, in the Criteria of your date field,
    put the equivalent of this...
    Between [Forms]![NameOfForm]![1stTextbox] And
    [Forms]![NameOfForm]![2ndTextbox]

    --
    Steve Schapel, Microsoft Access MVP

    nathan wrote:
    > i have a form where someone will enter two dates. i want to update the query
    > where it searches for records that are in between those dates. then i want to
    > export the query to excel on my desktop. i know how to do the second part but
    > i can not figure out how to changes the parameters of that field. if anyone
    > has any suggestions it would really be a big help. thanks.
     
  4. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Wed, 7 Jun 2006 11:57:47 -0700, nathan
    <nathan@discussions.microsoft.com> wrote:

    >i have a form where someone will enter two dates. i want to update the query
    >where it searches for records that are in between those dates. then i want to
    >export the query to excel on my desktop. i know how to do the second part but
    >i can not figure out how to changes the parameters of that field. if anyone
    >has any suggestions it would really be a big help. thanks.


    Simply use

    >= [Forms]![NameOfYourForm]![txtFromDate] AND < DateAdd("d", 1, [Forms]![NameOfYourForm]![txtToDate])


    as your criterion. That way the query can be used whenever needed,
    without needing any changes - it will simply pull the dates from the
    form.

    The DateAdd() bit is to ensure that if your table field contains a
    time portion, you'll get the results for the end date.

    John W. Vinson[MVP]
     
  5. nathan

    nathan
    Expand Collapse
    Guest

    it worked perfectly. thanks alot

    "Steve Schapel" wrote:

    > Nathan,
    >
    > In the design view of your query, in the Criteria of your date field,
    > put the equivalent of this...
    > Between [Forms]![NameOfForm]![1stTextbox] And
    > [Forms]![NameOfForm]![2ndTextbox]
    >
    > --
    > Steve Schapel, Microsoft Access MVP
    >
    > nathan wrote:
    > > i have a form where someone will enter two dates. i want to update the query
    > > where it searches for records that are in between those dates. then i want to
    > > export the query to excel on my desktop. i know how to do the second part but
    > > i can not figure out how to changes the parameters of that field. if anyone
    > > has any suggestions it would really be a big help. thanks.

    >
     

Share This Page