Option Group toggle button

D

Daniel Attard

Can anyone please tell me whether it is possible to make
individual toggle buttons within an option group either
visible or not visible, depending on whether or not a
file exists in a specified directory? Thanks.

I have an option group with 10 toggle buttons, but I only
want sometimes I only want to see 6 of the 10, other
times 4 of the 10, etc.
 
D

Dirk Goldgar

Daniel Attard said:
Can anyone please tell me whether it is possible to make
individual toggle buttons within an option group either
visible or not visible, depending on whether or not a
file exists in a specified directory? Thanks.

I have an option group with 10 toggle buttons, but I only
want sometimes I only want to see 6 of the 10, other
times 4 of the 10, etc.

Sure. For example,

If Len(Dir("C:\My Path\My File.txt")) = 0 Then
' the file doesn't exist.
Me.Toggle1.Visible = True
Me.Toggle2.Visible = False
Me.Toggle3.Visible = True
Else

' the file exists.
Me.Toggle1.Visible = False
Me.Toggle2.Visible = True
Me.Toggle3.Visible = False
End If
 

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