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. -
-
Private Sub Report_page()
-
Dim Picture1 As String
-
Dim Picture2 As String
-
Dim Picture3 As String
-
Dim Picture2Genus As String
-
Dim Picture3Genus As String
-
-
Picture1 = "P:\Lab Pictures\" & ProductID & "Stock.jpg"
-
Picture2 = "P:\Lab Pictures\" & ProductID & "St2.jpg"
-
Picture3 = "P:\Lab Pictures\" & ProductID & "St3.jpg"
-
Picture2Genus = "P:\Lab Pictures\" & Left(ProductID, 3) & "St2.jpg"
-
Picture3Genus = "P:\Lab Pictures\" & Left(ProductID, 3) & "St3.jpg"
-
-
If Dir(Picture1) = "" Then 'Checks for Stock Picture
-
Me!Image1.Picture = "P:\AccessPics\nopic.bmp"
-
Else
-
Me!Image1.Picture = Picture1
-
End If
-
-
If Dir(Picture2) = "" Then 'Checks for Stage 2 Picture
-
If Dir(Picture2Genus) = "" Then 'Checks for Genus Stage 2Picture
-
Me!Image2.Picture = "P:\AccessPics\nopic.bmp"
-
Else
-
Me!Image2.Picture = Picture2Genus
-
End If
-
Else
-
Me!Image2.Picture = Picture2
-
End If
-
-
If Dir(Picture3) = "" Then 'Checks for Stage 3 Picture
-
If Dir(Picture3Genus) = "" Then 'Checks for Genus Stage 3 Picture
-
Me!Image3.Picture = "P:\AccessPics\nopic.bmp"
-
Else
-
Me!Image3.Picture = Picture3Genus
-
End If
-
Else
-
Me!Image3.Picture = Picture3
-
End If
-
End Sub
-
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.
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.
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?
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
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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...
|
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.
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
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...
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |