473,473 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Conditional Pictures in a report

20 New Member
Hi, I've run into a snag here and hopefully someone here can help. Basically what I'm trying to do is set it up so the user only needs to place a properly formatted picture in a directory to get it to show up in the report. The problem I'm running into is that each record shows up on two or more pages, when I have my code set to run on current it never runs, so I've tried to run the code on page, the problem is that as soon as I get to the next page, the ProductID shows up as the next record on the list, not the current one. What really makes it confusing is that the rest of the information on the page is still for the correct item. Thanks in advance for any help you can offer.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Report_page()
  3.     Dim Picture1 As String
  4.     Dim Picture2 As String
  5.     Dim Picture3 As String
  6.     Dim Picture2Genus As String
  7.     Dim Picture3Genus As String
  8.  
  9.     Picture1 = "P:\Lab Pictures\" & ProductID & "Stock.jpg"
  10.     Picture2 = "P:\Lab Pictures\" & ProductID & "St2.jpg"
  11.     Picture3 = "P:\Lab Pictures\" & ProductID & "St3.jpg"
  12.     Picture2Genus = "P:\Lab Pictures\" & Left(ProductID, 3) & "St2.jpg"
  13.     Picture3Genus = "P:\Lab Pictures\" & Left(ProductID, 3) & "St3.jpg"
  14.  
  15.     If Dir(Picture1) = "" Then 'Checks for Stock Picture
  16.         Me!Image1.Picture = "P:\AccessPics\nopic.bmp"
  17.     Else
  18.         Me!Image1.Picture = Picture1
  19.     End If
  20.  
  21.     If Dir(Picture2) = "" Then 'Checks for Stage 2 Picture
  22.         If Dir(Picture2Genus) = "" Then 'Checks for Genus Stage 2Picture
  23.             Me!Image2.Picture = "P:\AccessPics\nopic.bmp"
  24.         Else
  25.             Me!Image2.Picture = Picture2Genus
  26.         End If
  27.     Else
  28.         Me!Image2.Picture = Picture2
  29.     End If
  30.  
  31.     If Dir(Picture3) = "" Then 'Checks for Stage 3 Picture
  32.         If Dir(Picture3Genus) = "" Then 'Checks for Genus Stage 3 Picture
  33.             Me!Image3.Picture = "P:\AccessPics\nopic.bmp"
  34.         Else
  35.             Me!Image3.Picture = Picture3Genus
  36.         End If
  37.     Else
  38.         Me!Image3.Picture = Picture3
  39.     End If
  40. End Sub
  41.  
Nov 19 '08 #1
4 2885
ADezii
8,834 Recognized Expert Expert
I'm trying to do is set it up so the user only needs to place a properly formatted picture in a directory to get it to show up in the report. The problem I'm running into is that each record shows up on two or more pages, when I have my code set to run 'on current' it never runs
Ares6881, I'm a little confused since Reports do not have a Current() Event.
Nov 20 '08 #2
Ares6881
20 New Member
I'm running Access 2007, it's showing up as an option for some reason, I can post a screen shot, but right now I'm using the on Page event anyway.
Nov 20 '08 #3
ADezii
8,834 Recognized Expert Expert
I'm running Access 2007, it's showing up as an option for some reason, I can post a screen shot, but right now I'm using the on Page event anyway.
This is very difficult to envision what is going on without the actual DB. If I sent you my E-Mail Address in a Private Message, would you be able to send me the Database, or a subset of it, along with some sample graphics?
Nov 21 '08 #4
Ares6881
20 New Member
Unfortunately, the database itself contains proprietary information, and with all the links to other tables, etc.. It would likely take quite a bit to break it out. Essentially what's going on is when the on page event runs the information is from the next page instead of the page that I'm on, and since it's in two pages the first page has the correct information, while the second one has the information for the next item on the list (in the VBA code only). As a stop gap I've moved all the photos to the first page so they are showing correctly now.

Here's an example of how things are showing up:

Page.......---1 2 3 4 5 6

ProductID---A A B B C C

ProductID---A B B C C D
showing up
in VB Code
Nov 21 '08 #5

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

Similar topics

0
by: JakeC | last post by:
Hey all, I'm currently redesigning a website that a friend and I started about a year ago. It is a daily surf report so when choosing the best script/language to use for the new design, I found...
4
by: Dale Ring | last post by:
Access 2000 I am trying to print a report that only some of the records have pictures. When the report prints, I do not want a blank image control showing on the report. This project is a test...
1
by: Majstor | last post by:
Does anybody know how to export Report in Word, Excel or HTML with pictures (Access 2000)? I don't use snapshot format.
2
by: Von Bailey | last post by:
I have a form where the conditional formatting is set on some fields to bold if certain conditions are met. However, when the conditions are met some of the data that is to bold is either not...
3
by: Chuck Reed | last post by:
I am working on a sales report where I show weekly sales by category for each of the 52 weeks in the year. Each record in my table/report has the 52 weeks of sales in it. I want to highlight to top...
5
by: Andrew Chanter | last post by:
Does anyone know a way you can use conditional formatting to create a banded style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd...
1
by: ammarton | last post by:
Hello all...I'm a bit new to working with Macros in Access so forgive me if the terminology I use is not accurate. To preface this, basically I am using a form on a replicated database so the...
12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
4
by: riaane | last post by:
Please help: I have Conditional Formatting on a Report Field that fills the background Red if the criteria is met. This displays correctly in Report View, however, when I "OutputTo" this report to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.