Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show images based on selection

Status
Not open for further replies.

pdtit

Technical User
Nov 4, 2001
206
BE
Hello,

I have a listbox on my form which allows the user to select a payment method (eg. cash, visa, mastercard,...)

I've pasted 3 small images on my form, made them invisible. What I'd like to do is make one visible based on the selection made. As such, the payment method will be emphasized to the user.

I started using coding that looks like:

If me.paymethod = 1 then
me.imgcash = visible
else
if me.paymethod = 2 then
me.imgvisa = visible
...

This is fine for me, as long as I have not that many options. However, this is quite "static".


How could I achieve the same result using another technique?

Kind regards,

Peter
 
How are ya pdtit . . .

Have a look at the [blue]Choose[/blue] Function . . . and don't forget that you have hide the others!

Calvin.gif
See Ya! . . . . . .
 
you have hide the others
You may try this:
Me!imgcash.Visible = (Me!paymethod = 1)
Me!imgvisa.Visible = (Me!paymethod = 2)
...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Could I achieve the same using a Select... Case... in my vba ? Or is this not the right solution for this result?

Regards,

Peter
 
pdtit . . .

Since you only have 3 conditions, its really not gonna matter . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top