Enabling Fields in Forms

borgia

Registered User.
Local time
Today, 23:13
Joined
Apr 22, 2005
Messages
10
I want a form to default open in read only mode to avoid users deleting info. I want them to be able to edit the form by pressing a button. Does anyone know the VB code to run from a command button to do this.

Regards :confused:
 
set up the button with an Event Procedure

Code is

Control Name.enabled=true

or Control Name.Locked= False

There may be a conflict with the Read Only open mode, not sure. ??

In design view you could set all fields Locked=True and open form in Edit mode

Locked.false code above should work okay then

HTH

L
 
set up the button with an Event Procedure

Code is

Control Name.enabled=true

or Control Name.Locked= False

There may be a conflict with the Read Only open mode, not sure. ??

In design view you could set all fields Locked=True and open form in Edit mode

Locked.false code above should work okay then

HTH

L
 
set up the button with an Event Procedure

Code is

Control Name.enabled=true

or Control Name.Locked= False

There may be a conflict with the Read Only open mode, not sure. ??

In design view you could set all fields Locked=True and open form in Edit mode

Locked.false code above should work okay then

HTH

L
 
set up the button with an Event Procedure

Code is

Control Name.enabled=true

or Control Name.Locked= False

There may be a conflict with the Read Only open mode, not sure. ??

In design view you could set all fields Locked=True and open form in Edit mode

Locked.false code above should work okay then

HTH

L
 
Under the form property data tab set the Record Set type to 'Snapshot'

Then create your button and name it Lock. Set the Caption to "Edit Records"
Then under the event tab choose click and paste in this code:

Private Sub Lock_Click()

If Me![Lock].Caption = "Edit Records" Then
Me.RecordsetType = 0
Me![Lock].Caption = "Lock Records"
DoCmd.ShowAllRecords
Else
Me.RecordsetType = 2
Me![Lock].Caption = "Edit Records"
DoCmd.ShowAllRecords
End If

End Sub


Hope this works for you
Sam
 
You can control what the user can to do to the data in a form by using the following commands in the forms OnCurrent event [and/or with the click of a command button]. Search around for there are posted examples on how to check who the user is and set their rights based on who the user is or by which workgroup they are logged in as.

Code:
Me.AllowAdditions = False
Me.AllowDeletions = False
Me.AllowEdits = False
 

Users who are viewing this thread

Back
Top Bottom