Bring To Front

P

PaleRider

Hi,

I have several embedded pictures and depending on the value in cboPicture I
want to display the matching picture. I have tried setting the visible
property to true, but that is not working. I think I need a way to execute
the "Bring Forward" command. Is there a way to do this. My code follows:

Select Case Me.cboPictures.Column(1)
Case "Bronze"
Me.Bronze.Visible = True

Case "Silver"
Me.Silver.Visible = True

Case "Gold"
Me.Gold.Visible = True

Case "Platinum"
Me.Platinum.Visible = True

Case Else
Me.Blank.Visible = True
End Select
 
S

Sam Davis

I think you'll need to first set Visible=False for all pics and then your
code to set the relevant pic's Visible property to true.

HTH
Sam
 
P

PaleRider

Sam,

I set all pics visible property = false, then in code set it true for each
pic but it still won't work. The first pic stays visible on every record.
Initially, I was loading each pic from the hard drive and that worked but I
noticed a progress window pops up each time it loads a picture. Very
annoying when you scroll through different records.

KP
 
M

Marshall Barton

PaleRider said:
I have several embedded pictures and depending on the value in cboPicture I
want to display the matching picture. I have tried setting the visible
property to true, but that is not working. I think I need a way to execute
the "Bring Forward" command. Is there a way to do this. My code follows:

Select Case Me.cboPictures.Column(1)
Case "Bronze"
Me.Bronze.Visible = True

Case "Silver"
Me.Silver.Visible = True

Case "Gold"
Me.Gold.Visible = True

Case "Platinum"
Me.Platinum.Visible = True

Case Else
Me.Blank.Visible = True
End Select


Bring to Front and Send to Back are strictly design time
actions so you can not use them at run time.

I think the reason your Visible idea isn't working is
because you did not make the other pictures invisible.

Try using code like:

Me.Bronze.Visible = (Me.cboPictures.Column(1) = "Bronze")
Me.Silver.Visible = (Me.cboPictures.Column(1) = "Silver")
Me.Gold.Visible = (Me.cboPictures.Column(1) = "Gold")
Me.Platinum.Visible = (Me.cboPictures.Column(1) =
"Platinum")
 
S

Sam Davis

I mean you'll need to set all pics visible property = false in CODE just
prior to your existing code that sets the approriate pic's visible property
=True. Currently the pics are progressively made visible as new records are
displayed.

Sam
 
P

PaleRider

Sam,

Thanks a million. I made the changes you suggested and everything works
flawless and a lot faster. Your brilliant :)

PR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top