Report formating related question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two Image/picture Inserted in my report design.
Report Name "EmplRepo"
Two images are "Image1" and other is "Image2"

Now both the picture are half on each other (I mean Image2 is covering the
half of the Image1 space). I want to bring Image1 on BRINGTOFRONT when it
meets a criteria, if it does meet the criteria it will be SENDTOBACK.

The same I use to do manually from tools by selecting the Image -
Format-Bring to Front OR Send to Back.

The same I want to do based on a criteria with the help of code when the
report previews.

Could any of the professional can advise what code show I write.

Thanks.
 
You could use code in the on format event of the report section containing
the images to set one or the other invisible based on a criteria.

Me.Image1.Visible = (Me.chkShowOne = True)
Me.Image2.Visible = Not (Me.chkShowOne = True)
 
Hi Sir,
Pls. read my question once again, i want to bring Image1 in front of Image2
based on criteria, but your solution is about visible or not visible.
Pls. advise. Regards.
 
Do you still want to show parts of both images? If so, you might use my
solution with an extra Image1. Arrange the images with Image2 sandwiched
between to copies of image1. All you need to do then is make the front copy
of Image1 visible or invisible.
 
Hi Sir,
I am sorry that I am unable to make you understand my need exactly. I will
try once again. In my report 2 nos. of images are there. It is pasted in such
a way that Image1 is been covered only half of the image by Image2 (pls. note
that it is not fully covered by the image2,it has a meaning when the image1
is on top and the meaning changes Image 2 is on top. Both image should be
visible, that also important).
Now the based on criteria, the image1 should be sendback to image2 And if
does not meet the criteria, it will be in front of image2.

I was suspecting code something like below, which does not show error
neither it does any things when the report opens :

Private Sub Report_Open(Cancel As Integer)
If Me.Text2 = 1 Then
With Me.Image0
DoCmd.RunCommand acCmdBringToFront
End With
Else
With Me.Image0
DoCmd.RunCommand acCmdSendToBack
End With
End If

End Sub


Please advise.
 
Did you try my previous response? It should work. If it didn't work then
please come back with what exactly you tried and your results.
 
Sir,
I tried the code you advised. Its hides either of the image when its meets
the criteria accordingly. But I dont want to hide any of the images. Only the
thing is In front of Image2 or Back of Image2. Both the images must be
visible on the report.
Regards.
 
I don't think you understand that:
1) I doubt you can change the front to back in run-time
2) my suggested solution of 3 images should accomplish the same thing.

-let's assume you have 3 index cards
-write a big 1 on two of them and a big 2 on the other
-place one of the 1's on your desk
-place the 2 on the 1 with some of the 1 showing
-place the remaining 1 on top of the 2 and totally aligned with the first 1.

It now looks like you have only a 1 and a 2 with the 1 being in front. Make
the top 1 invisible and it now appears that you again have only a 1 and a 2
with the 2 being in front.

Isn't this what you want?
 
Back
Top