how to protect field

G

Guest

I have date field in a form, which can be entered only once

it should not allow any changes onto that field if done later e.g delted, or
reentered it

thanks
 
R

Rick Brandt

Gerald said:
I have date field in a form, which can be entered only once

it should not allow any changes onto that field if done later e.g
delted, or reentered it

In the Current event of the form...

Me!TextBoxName.Locked = Not IsNull(Me!TextBoxName)

As the user navigates between records that code will lock the TextBox on any
record where it is already filled in.
 
K

Keith W

Gerald said:
I have date field in a form, which can be entered only once

it should not allow any changes onto that field if done later e.g delted,
or
reentered it

thanks

Put some code in the form's On Current event (untested):

If IsNull(Me.txtMyDate) Then
Me.txtMyDate.Locked = True
Else
Me.txtMyDate.Locked = False
End If

HTH - Keith.
www.keithwilby.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top