gakiss2
Registered User.
- Local time
- Today, 04:49
- Joined
- Nov 21, 2018
- Messages
- 168
Private Sub Toggle36_Click()
Dim Toggle As Boolean
If Toggle = False Then
Toggle = True
Else: Toggle = True
End If
If Toggle = True Then
DoCmd.SelectObject acForm, CboSQEPicker
DoCmd.SetProperty CboSQEPicker, acPropertyVisible, 0
Else: DoCmd.SetProperty CboSQEPicker, acPropertyVisible, -1
End If
End Sub
I tried to find the answer on the magical Google machine but I think this one is so simple that all the solutions went way over what I wanted to do. I am a bit new but starting to get used to form controls but I had not yet used a toggle. I found a situation where it would be a good approach I think so I tried to program what I wanted but it didn't work. To me it seems I tried to reinvent the toggle but just don't know the right code to make it do what it is designed to do.
The behavior wanted is to push this button to turn of or off a control which should only be used by a supervisor. By on or off I was trying to simply use the 'visible' property. At this point I am not needing any real security, just encouraging users to leave that control alone unless they are a supervisor. Maybe later I can distinguish between a Supv user and a regular user and attach permissions but that is above my ability at this point. So I am trying to get the form to work on a basic level first then add these security bells and whistles later. I have the advantage of being very amateur so there are very low expectations for my performance as a MS Access crackerjack . Your help is appreciated.
Dim Toggle As Boolean
If Toggle = False Then
Toggle = True
Else: Toggle = True
End If
If Toggle = True Then
DoCmd.SelectObject acForm, CboSQEPicker
DoCmd.SetProperty CboSQEPicker, acPropertyVisible, 0
Else: DoCmd.SetProperty CboSQEPicker, acPropertyVisible, -1
End If
End Sub
I tried to find the answer on the magical Google machine but I think this one is so simple that all the solutions went way over what I wanted to do. I am a bit new but starting to get used to form controls but I had not yet used a toggle. I found a situation where it would be a good approach I think so I tried to program what I wanted but it didn't work. To me it seems I tried to reinvent the toggle but just don't know the right code to make it do what it is designed to do.
The behavior wanted is to push this button to turn of or off a control which should only be used by a supervisor. By on or off I was trying to simply use the 'visible' property. At this point I am not needing any real security, just encouraging users to leave that control alone unless they are a supervisor. Maybe later I can distinguish between a Supv user and a regular user and attach permissions but that is above my ability at this point. So I am trying to get the form to work on a basic level first then add these security bells and whistles later. I have the advantage of being very amateur so there are very low expectations for my performance as a MS Access crackerjack . Your help is appreciated.