Preivewing selected records in a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Toral Shah
    New Member
    • Apr 2007
    • 19

    Preivewing selected records in a report

    hello all!!!!
    i have a program of voucher entry....
    there are many records in the table Payment and voc_no is a primary key and auto numbered...
    now i want only selected records to appear in my report....
    like voc_no 1,4,6 on one day
    or 7,8,11 on the other....
    how should i do that....plz help me out with my query
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    How do you determine which ones to view? Does it follow some algorithm or is it up to the user?

    Comment

    • Toral Shah
      New Member
      • Apr 2007
      • 19

      #3
      Originally posted by Rabbit
      How do you determine which ones to view? Does it follow some algorithm or is it up to the user?
      it is upto the user which record to view.... for the time being i am using Between command in my query but that will display all records from X to Y...
      i dont want that....
      plz guide me if there is a solution to it....
      i will be very greatful

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        One way would be to have a checkbox in your table so that they can check which ones you want to print, then you can just query for those.

        Comment

        • Toral Shah
          New Member
          • Apr 2007
          • 19

          #5
          Originally posted by Rabbit
          One way would be to have a checkbox in your table so that they can check which ones you want to print, then you can just query for those.
          Isnt there any other option where the user types the record number and it previews the report

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            Originally posted by Toral Shah
            Isnt there any other option where the user types the record number and it previews the report
            There is, you'll need to write a sub or procedure that will takes a string in a defined structure and then write a filter statement by breaking down the string to find out which records they want.

            Comment

            • Toral Shah
              New Member
              • Apr 2007
              • 19

              #7
              Originally posted by Rabbit
              There is, you'll need to write a sub or procedure that will takes a string in a defined structure and then write a filter statement by breaking down the string to find out which records they want.
              well i am sorry to ask this but can u plz tell me how will i write the code as i cant figure it out.

              Comment

              • Rabbit
                Recognized Expert MVP
                • Jan 2007
                • 12517

                #8
                If you have no VBA experience then you'll want to take a look at this tutorial.

                If you have experience, then the easiest thing would be to have them enter the records in a strictly defined format. I recommend comma delineated for ease. But I suppose you can use any other delimiter but you'll just have to use replace() to change them to commas. After that it's just a matter of opening the report using the WhereCondition parameter built with In () and the string.

                Comment

                Working...