By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,173 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Creating a Images page in reports

P: 21
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!!!
Oct 15 '07 #1
Share this Question
Share on Google+
16 Replies


nico5038
Expert 2.5K+
P: 3,072
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)
Oct 15 '07 #2

P: 21
Where can I learn about Mod's? Never used them before.
Oct 15 '07 #3

nico5038
Expert 2.5K+
P: 3,072
Open some VBA code and activate the helpfile (F1)

Nic;o)
Oct 15 '07 #4

P: 21
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.
Oct 15 '07 #5

nico5038
Expert 2.5K+
P: 3,072
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)
Oct 15 '07 #6

P: 21
Sorry Nico but I am a novice when it comes to using Mods. So I use the suggestion in the criteria correct?
Oct 15 '07 #7

nico5038
Expert 2.5K+
P: 3,072
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)
Oct 15 '07 #8

P: 21
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
Oct 15 '07 #9

nico5038
Expert 2.5K+
P: 3,072
Sorry, must be MOD 2

Nic;o)
Oct 15 '07 #10

P: 21
If you are ever in washington DC I owe you a beer.
Oct 15 '07 #11

nico5038
Expert 2.5K+
P: 3,072
Will take a while, as I'm living in The Netherlands :-)

Success with your application !

Nic;o)
Oct 15 '07 #12

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

P: 21
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?
Oct 17 '07 #14

nico5038
Expert 2.5K+
P: 3,072
Best to post a new discussion to keep things easier to read for future readers.

Here one solution can be to use:
Expand|Select|Wrap|Line Numbers
  1. currentdb.execute ("INSERT INTO tblX ...")
  2.  
Nic;o)
Oct 17 '07 #15

P: 21
Ok. So what I want to do is on the before insert for a form I want seven other tables to add a record with the same FACID (facility ID number) that way I can conduct a query that if null will give an error message so they have to enter in data in the respective sub forms. So I will use this to insert the me.FacID with the current forms ID.

currentdb.execute ("INSERT INTO tblX ...")
Oct 17 '07 #16

nico5038
Expert 2.5K+
P: 3,072
Best to test when closing the main form. E.g. using a Dcount() function per table.

Nic;o)
Oct 17 '07 #17

Post your reply

Sign in to post your reply or Sign up for a free account.