Checkbox appear at certain values.

LizzleJ

Registered User.
Local time
Today, 23:52
Joined
May 7, 2006
Messages
10
Hey,

I have an extension checkbox on my form of which i only want visible when Friday or Saturday is selected from the "day" combo list.

Code:
Private Sub Day_Change()
If Day = "Friday" Or "Saturday" Then
Extension.SetFocus
Extension.Visible = True

Else
Extension.SetFocus
Extension.Visible = False
End If
End Sub

Need a bit of help correcting this.

Thanks

P.S sorry about title i didn't know how to phrase it lol
 
Hey,

I have an extension checkbox on my form of which i only want visible when Friday or Saturday is selected from the "day" combo list.

Code:
Private Sub Day_Change()
If Day = "Friday" Or "Saturday" Then
Extension.SetFocus
Extension.Visible = True

Else
Extension.SetFocus
Extension.Visible = False
End If
End Sub

Need a bit of help correcting this.

Thanks

P.S sorry about title i didn't know how to phrase it lol
 
you cannot set the focus to an object that is not visible. Just change the visible switch without changing the focus. You also need a "left" side of your second comparison:

Code:
Private Sub Day_Change()
     If (Day = "Friday") Or (Day = "Saturday") Then
          Extension.Visible = True
     Else
          Extension.Visible = False
     End If
End Sub
 
2 things. Change this:

If Day = "Friday" Or Day = "Saturday" Then

and drop the setfocus lines. Personally, I'd use the after update event of the combo rather than the change event.
 

Users who are viewing this thread

Back
Top Bottom