Report criteria

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arali
    New Member
    • Jan 2008
    • 24

    Report criteria

    I have made a database in Access
    I made a report criteria form on which i use to datpickers
    dtpicker0 and dtpicker1
    and two command button
    open button is used to open the report according to dates pick by user
    i made a macro to open the report
    and in where clause i use the following ccommand
    date between [forms]![formname]![datpicker0] and [forms]![formname]![datpicker1] and i place two text boxes on repot having caption From , To
    and control source of these boxes is Datpickers respectively.
    i have date field in my table . which is for inserting dates to table .
    Now this is not working .
    Please any expert help me .how to open report according specifed criteria in my database according to dates.
    thanks
    Regards
    <<ARALi>>
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by arali
    I have made a database in Access
    I made a report criteria form on which i use to datpickers
    dtpicker0 and dtpicker1
    and two command button
    open button is used to open the report according to dates pick by user
    i made a macro to open the report
    and in where clause i use the following ccommand
    date between [forms]![formname]![datpicker0] and [forms]![formname]![datpicker1] and i place two text boxes on repot having caption From , To
    and control source of these boxes is Datpickers respectively.
    i have date field in my table . which is for inserting dates to table .
    Now this is not working .
    Please any expert help me .how to open report according specifed criteria in my database according to dates.
    thanks
    Regards
    <<ARALi>>
    you need to refer to the name property of your datepickers, not the control source. See below for an example assuming your:datepicker s are named date0 and date1. Also, using Date in your expression/table is a bad idea because it is a reserved word in Access. I changed date to uDate in your expression. You also need to change it in your table.

    uDate between [forms]![formname]![date0] and [forms]![formname]![date1]

    Comment

    • arali
      New Member
      • Jan 2008
      • 24

      #3
      Originally posted by puppydogbuddy
      you need to refer to the name property of your datepickers, not the control source. See below for an example assuming your:datepicker s are named date0 and date1. Also, using Date in your expression/table is a bad idea because it is a reserved word in Access. I changed date to uDate in your expression. You also need to change it in your table.

      uDate between [forms]![formname]![date0] and [forms]![formname]![date1]

      Thank for your help
      I change date field to udate as you said
      but still it not working .
      whe i chosse same dates in both dtpicker ie 24-1-08 and 24-1-08
      the report displyas nothing it remain blanck. while both values not same .then i shows all data which i store in table.ie 24-1-08 and 25-1-08
      or 23-1-08 and 25-1-08 etc
      i use a textbox on the report which is bound to udate and not visible.
      Now please tell me how it show only the data of specified dates choose in both
      datepickers.say it only show data of 24-1-08 which is store in the table on mentioned date.
      And how it will show me all data when i not choose from datepickers.i.e they remains unchecked .
      the datepicker which i am using both have there own check boxes when i set check box =no in propertise of each dtpicker it give me error.
      And for the udate in my main form i also have a dtpicker which is bounded to the udate.And to display the current date i use the following coding in form load event dtpickername.te xt= date
      this show me the current date of system .now question is ! it store date in udate? i think i does because it controlsource is udate.
      I asked too many question but hopping as expert you can help me.
      Thank You i will be waiting for your kind reply.
      Regards
      <<ARALI>>

      Comment

      • puppydogbuddy
        Recognized Expert Top Contributor
        • May 2007
        • 1923

        #4
        Originally posted by arali
        Thank for your help
        I change date field to udate as you said
        but still it not working .
        whe i chosse same dates in both dtpicker ie 24-1-08 and 24-1-08
        the report displyas nothing it remain blanck. while both values not same .then i shows all data which i store in table.ie 24-1-08 and 25-1-08
        or 23-1-08 and 25-1-08 etc
        i use a textbox on the report which is bound to udate and not visible.
        Now please tell me how it show only the data of specified dates choose in both
        datepickers.say it only show data of 24-1-08 which is store in the table on mentioned date.
        And how it will show me all data when i not choose from datepickers.i.e they remains unchecked .
        the datepicker which i am using both have there own check boxes when i set check box =no in propertise of each dtpicker it give me error.
        And for the udate in my main form i also have a dtpicker which is bounded to the udate.And to display the current date i use the following coding in form load event dtpickername.te xt= date
        this show me the current date of system .now question is ! it store date in udate? i think i does because it controlsource is udate.
        I asked too many question but hopping as expert you can help me.
        Thank You i will be waiting for your kind reply.
        Regards
        <<ARALI>>
        I am not following everything you are saying, but it sounds like you are using an activeX date picker. If that is the case, I recommend that you use one of the following date pickers instead of the ActiveX one you are using because they are native ms access forms, don't cause any conflicts with different versions of ms access, and come with specific easy to install and use instructions.

        Are you interested in trying one of these free date pickers?

        Free popup calendar (month view) for selecting a date in a Microsoft Access database. The calendar is an Access form, so requires no additional VBA references.


        Comment

        • arali
          New Member
          • Jan 2008
          • 24

          #5
          Originally posted by puppydogbuddy
          I am not following everything you are saying, but it sounds like you are using an activeX date picker. If that is the case, I recommend that you use one of the following date pickers instead of the ActiveX one you are using because they are native ms access forms, don't cause any conflicts with different versions of ms access, and come with specific easy to install and use instructions.

          Are you interested in trying one of these free date pickers?

          Free popup calendar (month view) for selecting a date in a Microsoft Access database. The calendar is an Access form, so requires no additional VBA references.


          http://www.glump.net/dokuwiki/softwa...ss_date_picker

          Thank for your reply
          What i said is when i choose same date in both dtpicker in criteria form the
          report shows nothing no recored.
          But when the dates in report are not same then it show all data
          even ,not that recored which is store between the spcifeid dates.
          for example when i choose dates like 24-1-08 and 24-1-08
          then report sows nothing.
          And when i choose 23-1-08 and 25-1-08 now report show me all recored but the problem is now it show me recored of 22-1-08 ( i mean that all recoreds)
          which is not according to criteria(accord ing to criteria it should show me only recored of 23 jan and 25 jan") but this is not the case.
          I think i clearify what i am saying .Now you can help me betterly .
          I also down load dtpicker you sujjested
          thanks
          Regards
          <<ARALI>>

          Comment

          • puppydogbuddy
            Recognized Expert Top Contributor
            • May 2007
            • 1923

            #6
            Originally posted by arali
            Thank for your reply
            What i said is when i choose same date in both dtpicker in criteria form the
            report shows nothing no recored.
            But when the dates in report are not same then it show all data
            even ,not that recored which is store between the spcifeid dates.
            for example when i choose dates like 24-1-08 and 24-1-08
            then report sows nothing.
            And when i choose 23-1-08 and 25-1-08 now report show me all recored but the problem is now it show me recored of 22-1-08 ( i mean that all recoreds)
            which is not according to criteria(accord ing to criteria it should show me only recored of 23 jan and 25 jan") but this is not the case.
            I think i clearify what i am saying .Now you can help me betterly .
            I also down load dtpicker you sujjested
            thanks
            Regards
            <<ARALI>>
            Sounds like your datefield and your datepicker are using different date formats.

            1. Make sure your Windows location settings are correct? I would
            have thought that if the Windows regional settings are correct, that
            date formats would get handled according to your date format.

            2. Try this if the above does not help.
            Format(uDate,"d d/mm/yyyy") between [forms]![formname]![date0] and [forms]![formname]![date1]

            Comment

            • arali
              New Member
              • Jan 2008
              • 24

              #7
              Originally posted by puppydogbuddy
              Sounds like your datefield and your datepicker are using different date formats.

              1. Make sure your Windows location settings are correct? I would
              have thought that if the Windows regional settings are correct, that
              date formats would get handled according to your date format.

              2. Try this if the above does not help.
              Format(uDate,"d d/mm/yyyy") between [forms]![formname]![date0] and [forms]![formname]![date1]


              CAN YOU GIVE ME YOUR EMAIL ADDRESS THAT I CAN EMAIL MY DATABASE TO YOU .THAT YOU CHECK IT AND SEND ME BACK
              REGARD
              <<ARALI>>

              Comment

              • puppydogbuddy
                Recognized Expert Top Contributor
                • May 2007
                • 1923

                #8
                Originally posted by arali
                CAN YOU GIVE ME YOUR EMAIL ADDRESS THAT I CAN EMAIL MY DATABASE TO YOU .THAT YOU CHECK IT AND SEND ME BACK
                REGARD
                <<ARALI>>
                Unless your DB uses Access Version 2000, I won't be able to look at it. If it does use Access 2000, then you can get my email address by downoading the VCard in my profile.

                Comment

                Working...