Key Field Data Entry

  • Thread starter Thread starter Lori
  • Start date Start date
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.
 
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
 
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.
 
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.




.
 
Back
Top