N
Nosne
Is this possible? How can I create such a check box?
Is this possible? How can I create such a check box?
Allen Browne said:Use the AfterUpdate event procedure of the text box to set the Locked
property of the other controls:
Private Sub chk1_AfterUpdate
Dim bLock as Boolean
bLock = Nz(Me.chk1, False)
Me.[Text0].Locked = bLock
Me.[Text3].Locked = bLock
'etc.
End Sub
In the Current event procedure of the form, call the same code so it is
applied when you move record:
Private Sub Form_Current()
Call chk1_AfterUpdate
End Sub
This assumes the check box is bound to a yes/no field in your table.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
Nosne said:Is this possible? How can I create such a check box?
Nosne said:I'm a beginner so would you mind explaining in detail the parts of the
code.
I do have a yes/no field on the table. I want this to control the
editability of 9 other fields on the table. The table is about clients
and
checking this box will allow me to put information into these other fields
when the answer to the paticular check box question is yes.
thank you in advance for your helpful reply.
Allen Browne said:Use the AfterUpdate event procedure of the text box to set the Locked
property of the other controls:
Private Sub chk1_AfterUpdate
Dim bLock as Boolean
bLock = Nz(Me.chk1, False)
Me.[Text0].Locked = bLock
Me.[Text3].Locked = bLock
'etc.
End Sub
In the Current event procedure of the form, call the same code so it is
applied when you move record:
Private Sub Form_Current()
Call chk1_AfterUpdate
End Sub
This assumes the check box is bound to a yes/no field in your table.
Nosne said:Is this possible? How can I create such a check box?
Allen Browne said:Set the On Click event procedure of your check box to:
[Event Procedure]
Click the Build button (...) beside this.
Access opens the code window, and gives you the first and last lines
("Private Sub..." and "End Sub".)
Paste the code in between.
Replace "chk1" with the name of your check box.
Replace "Text0", "Text3", etc with the name of your 9 controls (repeating,
so you will have 9 lines.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Reply to group, rather than allenbrowne at mvps dot org.
Nosne said:I'm a beginner so would you mind explaining in detail the parts of the
code.
I do have a yes/no field on the table. I want this to control the
editability of 9 other fields on the table. The table is about clients
and
checking this box will allow me to put information into these other fields
when the answer to the paticular check box question is yes.
thank you in advance for your helpful reply.
Allen Browne said:Use the AfterUpdate event procedure of the text box to set the Locked
property of the other controls:
Private Sub chk1_AfterUpdate
Dim bLock as Boolean
bLock = Nz(Me.chk1, False)
Me.[Text0].Locked = bLock
Me.[Text3].Locked = bLock
'etc.
End Sub
In the Current event procedure of the form, call the same code so it is
applied when you move record:
Private Sub Form_Current()
Call chk1_AfterUpdate
End Sub
This assumes the check box is bound to a yes/no field in your table.
Is this possible? How can I create such a check box?
How can I cause the field and the associated label to turn grey when the box
is unchecked?
John W. Vinson said:The Enabled property is what you want for that.
John W. Vinson [MVP]
what changes do I make to the codes?