Automatically copy data from one form field to another

G

Guest

I have a database that tracks companies the ask for information as well as
who requested the information. The database has one table and is in Access
2002.
I'd like to have the data in selected fields automatically be copies to like
fields for the requester. So if I enter the name of a company, the same data
will populate the requester name field.
I found this sample in a message from Sprinter, dated 1/21/05:
Sure, Seth. Just do a series of assignment statements in the On_Click event
of the button:

Me![ShipToContact] = Me![BillToContact]
Me![ShipToAddress]=Me![BillToAddress]
etc.

seth said:
is there any way to copy data across fields within a table from a form?
on a lot of websites when you purchase something, you would have a bill
to/ship to address
i am building a form for this and would like to know if it is possible to
add a "same as ship to" checkbox that would copy the ship to address fields
to the bill to address fields
thanks

Is there a way to get this to happen without the use of a button. I'm
building the Db to LCD.
 
S

SusanV

Sure, just use the After Update event of the textbox you are inputting the
data to rather than a button's On Click event.
--
hth,
SusanV

RealGomer said:
I have a database that tracks companies the ask for information as well as
who requested the information. The database has one table and is in Access
2002.
I'd like to have the data in selected fields automatically be copies to
like
fields for the requester. So if I enter the name of a company, the same
data
will populate the requester name field.
I found this sample in a message from Sprinter, dated 1/21/05:
Sure, Seth. Just do a series of assignment statements in the On_Click
event
of the button:

Me![ShipToContact] = Me![BillToContact]
Me![ShipToAddress]=Me![BillToAddress]
etc.

seth said:
is there any way to copy data across fields within a table from a form?
on a lot of websites when you purchase something, you would have a bill
to/ship to address
i am building a form for this and would like to know if it is possible to
add a "same as ship to" checkbox that would copy the ship to address
fields
to the bill to address fields
thanks

Is there a way to get this to happen without the use of a button. I'm
building the Db to LCD.
 
G

Guest

Oh, it helps a lot, Susan. SO if I understand you correctly, in the
AfterUpdate box for the BillToContact field, I'd enter

Me![ShipToContact] = Me![BillToContact]


SusanV said:
Sure, just use the After Update event of the textbox you are inputting the
data to rather than a button's On Click event.
--
hth,
SusanV

RealGomer said:
I have a database that tracks companies the ask for information as well as
who requested the information. The database has one table and is in Access
2002.
I'd like to have the data in selected fields automatically be copies to
like
fields for the requester. So if I enter the name of a company, the same
data
will populate the requester name field.
I found this sample in a message from Sprinter, dated 1/21/05:
Sure, Seth. Just do a series of assignment statements in the On_Click
event
of the button:

Me![ShipToContact] = Me![BillToContact]
Me![ShipToAddress]=Me![BillToAddress]
etc.

seth said:
is there any way to copy data across fields within a table from a form?
on a lot of websites when you purchase something, you would have a bill
to/ship to address
i am building a form for this and would like to know if it is possible to
add a "same as ship to" checkbox that would copy the ship to address
fields
to the bill to address fields
thanks

Is there a way to get this to happen without the use of a button. I'm
building the Db to LCD.
 
J

John Vinson

Oh, it helps a lot, Susan. SO if I understand you correctly, in the
AfterUpdate box for the BillToContact field, I'd enter

Me![ShipToContact] = Me![BillToContact]

Actually, click the ... icon, select the Code Builder, and put this
line between the Sub and End Sub lines Access will provide for you.

John W. Vinson[MVP]
 
S

SusanV

Use the code builder, not directly in the properties...

RealGomer said:
Oh, it helps a lot, Susan. SO if I understand you correctly, in the
AfterUpdate box for the BillToContact field, I'd enter

Me![ShipToContact] = Me![BillToContact]


SusanV said:
Sure, just use the After Update event of the textbox you are inputting
the
data to rather than a button's On Click event.
--
hth,
SusanV

RealGomer said:
I have a database that tracks companies the ask for information as well
as
who requested the information. The database has one table and is in
Access
2002.
I'd like to have the data in selected fields automatically be copies to
like
fields for the requester. So if I enter the name of a company, the same
data
will populate the requester name field.
I found this sample in a message from Sprinter, dated 1/21/05:
Sure, Seth. Just do a series of assignment statements in the On_Click
event
of the button:

Me![ShipToContact] = Me![BillToContact]
Me![ShipToAddress]=Me![BillToAddress]
etc.

:

is there any way to copy data across fields within a table from a
form?
on a lot of websites when you purchase something, you would have a
bill
to/ship to address
i am building a form for this and would like to know if it is possible
to
add a "same as ship to" checkbox that would copy the ship to address
fields
to the bill to address fields
thanks


Is there a way to get this to happen without the use of a button. I'm
building the Db to LCD.
 

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