Check box order in form (1 Viewer)

oliver916

Registered User.
Local time
Today, 17:53
Joined
Nov 24, 2009
Messages
32
Hello my friends
i have a form with sum fields on it
i want to add a check box with this option
by marking the check box certain fields become disable & locked & by not marking they become unlocked & enable
is it possible?
 

John Big Booty

AWF VIP
Local time
Today, 23:53
Joined
Aug 29, 2005
Messages
8,262
You could do something along the lines of;
Code:
If Me.Your CheckBox = True Then
    Me.YourControlName.Enabled = False
    Me.YourControlName.Locked = True
Else
    Me.YourControlName.Enabled = True
    Me.YourControlName.Locked = False
End If

You would need this code in your Form's On Current event as well as the Check box's On Click event.
 

oliver916

Registered User.
Local time
Today, 17:53
Joined
Nov 24, 2009
Messages
32
Thanks allot
worked fine with me
& i need one more help
i need it to request a pass code when we are going to uncheck the checkbox
 

oliver916

Registered User.
Local time
Today, 17:53
Joined
Nov 24, 2009
Messages
32
I Have done it
this is the code
Code:
Dim strInput As String
Dim strMsg As String
Beep
strMsg = "Do You Want to Change the data?" & vbCrLf & vbLf & "Then Entre The Password"
strInput = InputBox(Prompt:=strMsg, title:="data change")
If strInput = "0000" Then
Me.Check35 = False

Beep
MsgBox "Changing allowed" & vbCrLf & vbLf & "Changes allowed", vbInformation, "Changing Allowed"
Else
Beep
Me.Check35 = True

MsgBox "Wrong Pasword" & vbCrLf & vbLf & "Changes not allowed" & vbCrLf & vbLf & "Changes not allowed", vbCritical, "Wrong Password"
Exit Sub
End If

i put this code just after "Else" in your code
& its working fine

bu i have small problem
if i want to disable all fields in certain form do i have to enter them manually like this code
Me.YourControlName.Enabled = False Me.YourControlName.Locked = True or there is a way to disable them all by one or two line?
 

Users who are viewing this thread

Top Bottom