Saphirah
Active member
- Local time
- Today, 07:38
- Joined
- Apr 5, 2020
- Messages
- 163
Hey everyone,
for my current Access Project i need to create a report and show/hide an image based on the size of the image.
For this i used the Paint and Print Event of the Details section of the report. My code looks like this
Screenshot is an image control with the control source set to a string value, that stores the file path of the image.
Now my problem is, whenever i try to execute the code, the message box returns 0 for both Width and height.
So my assumtion was that the image is probably not loaded yet. You can see the final image on the report though, so it is not a problem with the image file.
Does anyone know a different approach, that allows me to use ImageWidth and ImageHeight, or maybe determine the size of the image in a different way?
Thank you very much!
for my current Access Project i need to create a report and show/hide an image based on the size of the image.
For this i used the Paint and Print Event of the Details section of the report. My code looks like this
Code:
Private Sub Detail_Paint()
Screenshot.Visible = Screenshot.ImageWidth < 600 And Screenshot.ImageHeight < 600
MsgBox ("Width: " & Screenshot.ImageWidth & ", Height: " & Screenshot.ImageHeight)
End Sub
Screenshot is an image control with the control source set to a string value, that stores the file path of the image.
Now my problem is, whenever i try to execute the code, the message box returns 0 for both Width and height.
So my assumtion was that the image is probably not loaded yet. You can see the final image on the report though, so it is not a problem with the image file.
Does anyone know a different approach, that allows me to use ImageWidth and ImageHeight, or maybe determine the size of the image in a different way?
Thank you very much!