Display Picture depending on Combo Box.

djcawthorne

Registered User.
Local time
Today, 20:15
Joined
Jun 2, 2006
Messages
10
Hi all!
i am wanting to display a signature (jpeg image) when a combo box is displaying "Yes" and the picture to be hidden when the combo box is either empty or set as "No". i have before managed to change colours of other fields depending on combo boxes - but my coding isnt that great, so i dunno what code is req'd!

all help much appriciated!

thanks

Dave
 
My coding isn't all that great either, but maybe your use of a combo box isn't such a good idea if you just have a yes/no situation. For that, I would think a yes/no field would be better which could be displayed as a checkbox, or as an option group. You could then unhide your image depending on the state of the checkbox or option group [provided you have it hidden by default]; that would be only require a something simple similar to this

If [checkbox] = true then me.[image control].visible = true

which you'd place in the After Update event of the checkbox or option group and the main form's On Current event so that it'll show correctly when you browse records.
 
And a simpler coding option (also on the After Update event of the checkbox)would be:
Code:
me.[image control].visible = [checkbox]
 
Hi, i gave both those a go over the weekend, both with the same "invalid qualifier" error on the Me.Picture segment. i assume in the [image control] i put the name of the picture?

any help much appriciated :)
 
To make the image control visible when the checkbox is checked you would put:
Code:
me.YourImageControlNameHere.visible = [checkbox]
But to assign the actual picture you would use
Code:
Me.YourImageControlNameHere.Picture = PutTheVariableOrPathHere
changing YourImageControlNameHere to the actual name of the image control and PutTheVariableOrPathHere to the actual variable name you are assigning the picture's path to (or type the actual path to the picture if you are hard-coding a single value, which is not the way to go).
 

Users who are viewing this thread

Back
Top Bottom