create field on new rec but no updates allowed

techexpressinc

Registered User.
Local time
Today, 12:55
Joined
Nov 26, 2008
Messages
185
Is there a easy way to do this?

I tried Lock but then the users can not add a record. I want them to be able to add but then lock them out of updating a field.

Thx
Russ
 
In the form's On Current event put this:

Code:
Me.AllowEdits = Me.NewRecord
 
this code would be a new vb code module that this field would execute correct?
 
Lock updating of One field on the form

Bob -The is only one field on the form I need this rule in place for. The rest of the fields the users will be able to update normally.
Russ
 
Code:
Private Sub Form_Current()
If Me.NewRecord Then
    Me!NameOfControl.Locked = False
Else
    Me!NameOfControl.Locked = True
End If
End Sub


JR
 
On what event would this code be used?

I thinking it would be multiple places?

Before Update..
On Change ...
On Update...
On Exit..
On Click...


Does that sound right?

Thx
Rus
 
The OnCurrent event is enough, but if you want to lock it immediatly after entering data in the control, then lock it in the afterupdate_event of the control.

JR
 
So the control would be locked in the On Current event by using:
Code:
Me.MyControlNameHere.Locked = Not Me.NewRecord
 
And as in all similar scenarios, you'll need to figure out who will do what when a mistake is made, as it surely will!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom