Images visible when checkbox = true

james_IT

Registered User.
Local time
Today, 06:22
Joined
Jul 5, 2006
Messages
208
Hi all

I have a form that has two images on. They are set to visible=no.

I want them to be visible if a check box is ticked for each:


If Me.Vegetarian = True Then
Me.ImgVeg.Visible = True
Else
Me.ImgVeg.Visible = False

If Me.ContainsNuts = True Then
Me.ImgNuts.Visible = True
Else
Me.ImgNuts.Visible = False

End If


Firstly, is this code correct and secondly where do i put if (i already have code in the forms on current event, how do i add this?

thanks
 
>>>i already have code in the forms on current event<<<

The code looks fine to me, just shove it in the on current event with the other code! Alternatively you could wrap the code in a function and call the function from the current event, this is a better option if you want to make the images visible from a command button or some other place in your code.

Thanks. When I put it in with the other code in the current event when i open the form it says Compile Error: Block If wihtout end if.

Whats that all about?
 
got it!

thanks for that, i didnt notice...
 

Users who are viewing this thread

Back
Top Bottom