Creating a Images page in reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cynderborg
    New Member
    • Oct 2007
    • 21

    Creating a Images page in reports

    I currently am making a database that accomplishes a canned report. Part of it is an images "Attachment " to the report. I have figured out how to put the pictures in but I need to put 2 images side by side. The best way I can figure to do that is by placing a subreport next to the original in the detail section. I cannot find any information on how to figure odd and even numbers. In the detail section I want to put the odd numbers and in the subreport put the odd numbers. This way they should line up. Can anyone tell what the query should be to only show odd or even numbers? You would make me a happy employee!!!
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Did you check on the MOD statement?
    Using x MOD 1 will return 0 or 1 depending on the value of x. When you have a number that's incremented by one, then this can be used.

    Nic;o)

    Comment

    • cynderborg
      New Member
      • Oct 2007
      • 21

      #3
      Where can I learn about Mod's? Never used them before.

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Open some VBA code and activate the helpfile (F1)

        Nic;o)

        Comment

        • cynderborg
          New Member
          • Oct 2007
          • 21

          #5
          My calculation is based off the user establishing Image numbers. Example 1, 2, 3, 4, 5. Can I use the MOD in the VBA of the report to only display the evens or odds? I thought I had to use them in a query.

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            Why in the report?
            You can use the 0 for the mainreport query and the 1 for the subreport query to get the needed division.

            Nic;o)

            Comment

            • cynderborg
              New Member
              • Oct 2007
              • 21

              #7
              Sorry Nico but I am a novice when it comes to using Mods. So I use the suggestion in the criteria correct?

              Comment

              • nico5038
                Recognized Expert Specialist
                • Nov 2006
                • 3080

                #8
                The MOD function (when using the value 1) will return a 0 or a 1 depending on the value of the passed variable.
                When you have an imagenumber 1,2,3,4,... using in your query:

                SELECT [imagenumber], [imagenumber] MOD 1 As OddEven, ...

                Will return:
                1, 0, ..
                2, 1, ...
                3, 0, ...
                4, 1, ...
                etc.
                This OddEven field can be used to filter the "0" records for the mainform and the "1" records for the subreport.

                Getting the idea ?

                Nic;o)

                Comment

                • cynderborg
                  New Member
                  • Oct 2007
                  • 21

                  #9
                  using the following statement


                  SELECT [imageno], [imageno] MOD 1 As OddEven
                  FROM PictureTable;


                  Got me

                  1 0
                  2 0
                  3 0
                  4 0
                  5 0

                  Comment

                  • nico5038
                    Recognized Expert Specialist
                    • Nov 2006
                    • 3080

                    #10
                    Sorry, must be MOD 2

                    Nic;o)

                    Comment

                    • cynderborg
                      New Member
                      • Oct 2007
                      • 21

                      #11
                      If you are ever in washington DC I owe you a beer.

                      Comment

                      • nico5038
                        Recognized Expert Specialist
                        • Nov 2006
                        • 3080

                        #12
                        Will take a while, as I'm living in The Netherlands :-)

                        Success with your application !

                        Nic;o)

                        Comment

                        • cynderborg
                          New Member
                          • Oct 2007
                          • 21

                          #13
                          Ok. Thanks. It looks great. You don't know how long I hve been looking for a solution. Have a great week.

                          Comment

                          • cynderborg
                            New Member
                            • Oct 2007
                            • 21

                            #14
                            In a database I want to add a record to several tables that are not currently open on the form. I used to toy with recordsets but have since forgotten (old age). How do I add a record and then insert some text? The filed I want to insert is an ID (I call it FACID for Facility ID that is my common link to all tables because the tool reports on facilities). Any help would be appreciated.

                            NICO you know?

                            Comment

                            • nico5038
                              Recognized Expert Specialist
                              • Nov 2006
                              • 3080

                              #15
                              Best to post a new discussion to keep things easier to read for future readers.

                              Here one solution can be to use:
                              Code:
                              currentdb.execute ("INSERT INTO tblX ...")
                              Nic;o)

                              Comment

                              Working...