Hi,
I have had some success with the help received here in making controls in my
forms locked if they have already been filled in and unlocked if they are
empty to allow the initial data entry.
I now have another problem. Two of the controls in question have default
values. One has one character and the other has 2. I have tried the code
below in variations, but only the box_no works, as it is simply empty of not.
The other two controls don't allow me to edit existing data, but also don't
allow me to enter the initial data!
Any suggestions would be greatly appreciated!

Signature
Thanks!
Dee
dee - 31 Jan 2008 15:57 GMT
Forgot to post code:
Me.box_no.Locked = Not IsNull(Me.box_no)
If Len(Me.txt_ppt_no) = 9 Then
Me.txt_ppt_no.Locked = True
End If
If Len(Me.txt_study_no & vbNullString) < 3 Then
Me.txt_study_no.Locked = False
End If

Signature
Thanks!
Dee
> Hi,
> I have had some success with the help received here in making controls in my
[quoted text clipped - 8 lines]
>
> Any suggestions would be greatly appreciated!
Marshall Barton - 31 Jan 2008 17:33 GMT
>Forgot to post code:
> Me.box_no.Locked = Not IsNull(Me.box_no)
[quoted text clipped - 5 lines]
> Me.txt_study_no.Locked = False
>End If
I think you can get away with checking if they are the same
as the default value.
If Not (IsNull(Me.txt_ppt_no) Or Me.txt_ppt_no = _
Eval(Me.txt_ppt_no.DefaultValue)) Then
Me.txt_ppt_no.Locked = True
End If
If Not (IsNull(Me.txt_study_no) Or Me.txt_study_no = _
Eval(Me.txt_study_no.DefaultValue)) Then
Me.txt_study_no.Locked = False
End If

Signature
Marsh
MVP [MS Access]
dee - 31 Jan 2008 18:43 GMT
Hi Marshall,
Thanks so much. I fiddled around with the code and it's working.
I appreciate your help and sharing your knowledge!

Signature
Thanks!
Dee
> >Forgot to post code:
> > Me.box_no.Locked = Not IsNull(Me.box_no)
[quoted text clipped - 17 lines]
> Me.txt_study_no.Locked = False
> End If