Key Field Data Entry

L

Lori

Hello everyone,

Hope someone can help me. I have a form that instead of
an autonumber key field. I have a number field to be
entered (SSN or TIN). I'm having problems with staff
entering in just any (Dummy) number just to get the
contact in and then at a later date going back in and
entering in the SSN or TIN. This is causing a problem
because when the contact is used in other areas of the
database, and then the number is changed the contact
disappears from the other areas. To eliminate this
problem I would like to lock this field once exiting from
the contact screen, once the form is filled out. I would
like for them to have the ability to change that number
only at the initial entry before exiting. Can anyone
tell me how to do this? Thanks in advance.
 
N

Nikos Yannacopoulos

Lori,

Put the following code behind the form's On Current event:

If Me.NewRecord Then
Me.txtSSN.Enabled = True
Else
Me.txtSSN.Enabled = False
End If

where I have assumed the control's name to be txtSSN (change to the actual
name). This event fires when you first open the form, and every time you
move to another record, existing or new. This piece of code will only enable
the control on a new record, keeping it disabled on existing ones, so users
cannot make changes in it in an existing record.

HTH,
Nikos
 
T

Terry

If your using the SSN as an index then setup the field in the table as
required, indexed,no duplicates and make a relationship with the other table
or tables so that any changes are cascaded down.
 
L

Lori

This works, thanks
-----Original Message-----
If your using the SSN as an index then setup the field in the table as
required, indexed,no duplicates and make a relationship with the other table
or tables so that any changes are cascaded down.




.
 

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

Similar Threads

Open form, fill in field 2
Dates: "Yesterday" vs "Today" 10
Forms 3
Auto Populate a Field 1
DoCmd.Close not saving data. 1
Automatic Field Entry 1
Data Entry, lookup existing 2
Field to field validation 8

Top