cansevin
asked on
Check box Visible
I have code for an "On Current" event of a form. It is working if the value = 1... it doesnt' know what to do if the value isn't. If the value isn't 1, I need the Me.chkBooked to be invisible. Any ideas?
Thanks!
Thanks!
ASKER
I forgot... the code I am using is below. I need to make it "invisible" if the value is not 1
Private Sub Form_Current()
Me.chkBooked.Visible = Me.Frame109.Value = 1
End Sub
Private Sub Form_Current()
Me.chkBooked.Visible = Me.Frame109.Value = 1
End Sub
Judging by the name, you must be using an Option Group. You need to also put your code in the AfterUpdate event of your Frame control.
In your OnCurrent event you could use the same code or better still just call the the other procedure, that way there's only one section that needs to be maintained rather than two.
As an aside, I would rename Frame109 to something more appropriate. Something like:
fraBookingSelection or grpBookingSelection maybe.
Private Sub Frame109_AfterUpdate()
Me.chkBooked.Visible = (Me.Frame109.Value = 1)
End Sub
In your OnCurrent event you could use the same code or better still just call the the other procedure, that way there's only one section that needs to be maintained rather than two.
Private Sub Form_Current()
Call Frame109_AfterUpdate
End Sub
As an aside, I would rename Frame109 to something more appropriate. Something like:
fraBookingSelection or grpBookingSelection maybe.
ASKER
Thanks for your help... Much appreciated. I added the "Call" to the Add current.
It is working when the value is 1. It just doesn't know what to do when the value is not 1 (which is to be invisible)
Is there an "Else" code to state that it should be invisible when the value is not 1?
It is working when the value is 1. It just doesn't know what to do when the value is not 1 (which is to be invisible)
Is there an "Else" code to state that it should be invisible when the value is not 1?
No it should work as this is written. There must be something else going on. Maybe you can upload a copy with just that form?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
glad I could help...
Open in new window