Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Record Locking

Author  Topic 

weedavie22
Starting Member

24 Posts

Posted - 2004-01-30 : 11:25:59
I want to lock every field in a form to prevent accidental change of information but would also like to have a button at the top of my form that allows the user to unlock all the fields in order to change information if need be.

Would this involve a lot of code??
Any help would be great.
Cheers

Dave

Ps. Table = Contacts
Fields = Title, First Name, Last Name

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2004-01-30 : 12:51:06
Drop onto the form a toggle button and attach to it this code:

Private Sub ToggleButton8_AfterUpdate()
If Me.ToggleButton8.Value = True Then
Me.Title.Enabled = False: Me.Title.Locked = True
Me.FirstName.Enabled = False: Me.FirstName.Locked = True
Me.LastName.Enabled = False: Me.LastName.Locked = True
Else
Me.Title.Enabled = True: Me.Title.Locked = False
Me.FirstName.Enabled = True: Me.FirstName.Locked = False
Me.LastName.Enabled = True: Me.LastName.Locked = False
End If
End Sub

Initial values of "Enabled" and "Locked" properties of these
three textboxes should be "False" and "True". By "Initial"
I mean these values right after the form opening.
Go to Top of Page

weedavie22
Starting Member

24 Posts

Posted - 2004-02-01 : 12:31:56
Nice one,

Cheers for your help
Go to Top of Page
   

- Advertisement -