boolean

kingsgambit

Registered User.
Local time
Today, 17:05
Joined
May 27, 2001
Messages
134
Can anybody help me to use a Boolean variable.
I have two buttons on a form one for editing and the other for read-only. Instead of making two forms with the different property set t read-onlt or edit I wanted to use the Boolean.
If a user clicked on edit the Boolean would be true, and the form that opened would set the propertys
i.e If Boolean = True then
Allowedit=true else
if the read-only button was clicked
i.e If Boolean = True then
Allowedit=false else
I can not get the form that opens to see what stage the Boolean is
 
I know this isn't a solution for the problem at hand, but you might consider using an option group instead of two buttons (you can actually make an option group look like two buttons also). Option groups have assigned values, so you can run your procedures based on which of the two options is selected, as well as assigning a default selection on the form.
 
Put this line in a module.
Public bReadOnly As Boolean


Put this procedure in your form that will open either ReadOnly or Not.
Private Sub Form_Load()
If bReadOnly = False Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If
End Sub

Use these for your two button click events.
Private Sub cmdAllowEdit_Click()
bReadOnly = True
End Sub

Private Sub cmdReadOnly_Click()
bReadOnly = False
End Sub


Good Luck Jerid
 

Users who are viewing this thread

Back
Top Bottom