Passing A Date Range

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RoadRunner

    #1

    Passing A Date Range

    Hi, I am having a problem. I have a very simple employee database.
    The client needs to see everything on a form before any updates or
    deletions can be made. I have a form that loads with two parameters
    (date range) a start date and a end date. I have two queries -
    Separation Update (adds to the separation table) and Separation Delete
    (deletes from the main table), they both run with the same parameters
    as the form. Is there a way that the user only has to enter once the
    Start Date and the End Date? I can't figure out how to pass the
    parameters from the form to the separation update query and then to
    the separation delete query. Any assistance would be welcome. Thanks
    in advance. Pat
  • Salad

    #2
    Re: Passing A Date Range

    RoadRunner wrote:
    Hi, I am having a problem. I have a very simple employee database.
    The client needs to see everything on a form before any updates or
    deletions can be made. I have a form that loads with two parameters
    (date range) a start date and a end date. I have two queries -
    Separation Update (adds to the separation table) and Separation Delete
    (deletes from the main table), they both run with the same parameters
    as the form. Is there a way that the user only has to enter once the
    Start Date and the End Date? I can't figure out how to pass the
    parameters from the form to the separation update query and then to
    the separation delete query. Any assistance would be welcome. Thanks
    in advance. Pat
    Here's one method. Lets say your form name is called UpdtDelForm.

    Open your query in design mode. Then under the start date column, in
    the criteria row, enter
    Forms!UpdtDelFo rm!StartDate
    and under the end date
    Forms!UpdtDelFo rm!EndDate

    Change the field/form names to relect your own.

    You could also check this out


    Comment

    • RoadRunner

      #3
      Re: Passing A Date Range

      The problem is that they are not separate fields, they are under one
      field (Date) in both the form and the query.

      On Sep 18, 1:54 pm, Salad <o...@vinegar.c omwrote:
      RoadRunner wrote:
      Hi,  I am having a problem.  I have a very simple employee database..
      The client needs to see everything on a form before any updates or
      deletions can be made.  I have a form that loads with two parameters
      (date range) a start date and a end date.  I have two queries -
      Separation Update (adds to the separation table) and Separation Delete
      (deletes from the main table), they both run with the same parameters
      as the form.  Is there a way that the user only has to enter once the
      Start Date and the End Date?  I can't figure out how to pass the
      parameters from the form to the separation update query and then to
      the separation delete query.  Any assistance would be welcome.  Thanks
      in advance. Pat
      >
      Here's one method.  Lets say your form name is called UpdtDelForm.
      >
      Open your query in design mode.  Then under the start date column, in
      the criteria row, enter
              Forms!UpdtDelFo rm!StartDate
      and under the end date
              Forms!UpdtDelFo rm!EndDate
      >
      Change the field/form names to relect your own.
      >
      You could also check this outhttp://www.mvps.org/access/queries/qry0003.htm

      Comment

      • Salad

        #4
        Re: Passing A Date Range

        RoadRunner wrote:
        The problem is that they are not separate fields, they are under one
        field (Date) in both the form and the query.
        If using Date as the fieldname, since it's a reserved word, use [Date]

        If 1 column for the date field, then use Between in the criteria. Ex
        Between [Forms]![Form1]![Date1] And [Forms]![Form1]![Date2]
        >
        On Sep 18, 1:54 pm, Salad <o...@vinegar.c omwrote:
        >
        >>RoadRunner wrote:
        >>
        >>>Hi, I am having a problem. I have a very simple employee database.
        >>>The client needs to see everything on a form before any updates or
        >>>deletions can be made. I have a form that loads with two parameters
        >>>(date range) a start date and a end date. I have two queries -
        >>>Separation Update (adds to the separation table) and Separation Delete
        >>>(deletes from the main table), they both run with the same parameters
        >>>as the form. Is there a way that the user only has to enter once the
        >>>Start Date and the End Date? I can't figure out how to pass the
        >>>parameters from the form to the separation update query and then to
        >>>the separation delete query. Any assistance would be welcome. Thanks
        >>>in advance. Pat
        >>
        >>Here's one method. Lets say your form name is called UpdtDelForm.
        >>
        >>Open your query in design mode. Then under the start date column, in
        >>the criteria row, enter
        > Forms!UpdtDelFo rm!StartDate
        >>and under the end date
        > Forms!UpdtDelFo rm!EndDate
        >>
        >>Change the field/form names to relect your own.
        >>
        >>You could also check this outhttp://www.mvps.org/access/queries/qry0003.htm
        >
        >

        Comment

        Working...