Option Group toggle button

  • Thread starter Thread starter Daniel Attard
  • Start date Start date
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.
 
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
 
Back
Top