Copying a Field

G

Guest

Hi all,

I have form form that contains a new button to input a new record. One
field is the primary key and a second field will for the some of the time
contain the same contents. The primary key is a number field as the contents
are pre assigned from a paper form. I am able to make the second field
contain the same contents as the first but with something similar to
me.[field]2=me.[field1] in the default value. However, when I select the new
button the PK [field1] is assigned 0 along with the [field2] but when I then
alter the PK field, [field2] is not updated. As I mentioned at sometime in
the future [field2] will be changed to its new value which then will not
reflect the PK [field1].

Many thanks for taking the time to read this, any and all ideas welcome.

Debbie D.
 
A

Al Camp

Debbie,
Since Field1 has no value on a new record, niether will Field2.
Use the AfterUpdate event of Field1 to trigger...
Field2 = Field1.

But... your PK field should not be "user editable", and should
auto-generate a unique value on all new records. (not come up empty)
I suggest you create a new Autonumber field in your table, do not allow
users access to it, and use that as the PK in your related tables.
are pre assigned from a paper form...
Your hand entered value would just be an Indexed NoDupes field.

hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Debbie D. said:
Hi all,

I have form form that contains a new button to input a new record. One
field is the primary key and a second field will for the some of the time
contain the same contents. The primary key is a number field as the
contents
are pre assigned from a paper form. I am able to make the second field
contain the same contents as the first but with something similar to
me.[field]2=me.[field1] in the default value. However, when I select the
new
button the PK [field1] is assigned 0 along with the [field2] but when I
then
alter the PK field, [field2] is not updated. As I mentioned at sometime in
the future [field2] will be changed to its new value which then will not
reflect the PK [field1].

Many thanks for taking the time to read this, any and all ideas welcome.

Debbie D.
 

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