Default Value Field

  • Thread starter Thread starter ServiceEnvoy
  • Start date Start date
S

ServiceEnvoy

Summary: Is it possible to make one field's default value equal
another field but still allow for editing?

Details: I have an autonumber field which is the unique ID for all our
records. We also use an internalID# field. Most of the time, it's
fine if the InternalID# is the same but sometimes we need to modify
it. I would like the InternalID# field to have a default value that
automatically assigns the same ID# to the InteralID# field as is
generated with the autonumber ID field.

Is this possible to do from the table or do I have to do an "after
update" event on the forms? Please tell me what coding I would need
to make this happen.
 
You cannot use Default Value for this, because of the timing.

Access applies the Default Value *before* anything is added.
The AutoNumber is assigned once you start adding a record.

Consequently, you will need to use form events.
 
You cannot use Default Value for this, because of the timing.

Access applies the Default Value *before* anything is added.
The AutoNumber is assigned once you start adding a record.

Consequently, you will need to use form events.

Good point. Can I do an after update event procedure that would
update the internal id field when the autonumber id field is edited
(which would only be the first time of course)?
 
Sure: use the AfterUpdate event procedure of the control to assign the value
to the other field.

I'm not sure exactly how you will implement that, as I did not follow the
bit about editing the autonumber.
 
Back
Top