CHECK BOX, BILLING ADDRESS = SHIPPING ADDRESS

C

Carol Shu

CHECK BOX, BILLING ADDRESS = SHIPPING ADDRESS

I HAVE A FORM FOR CUSTOMER’S BILLING AND SHIPPING INFO,
I WOULD LIKE TO HAVE A CHECK BOX FOR “BILLING ADDRESS = SHIPPING ADDRESSâ€,
THEREFOR WILL SAVE TIMES FOR USER AND HAVE SAME DATE LIKE BILLING ADDRESS,
LESS MISTAKE FOR TYPO ERRORS. IF THIS CHECK IS CHECKED, IT WILL AUTOMATICLY
FILL IN SHIPPING ADDRESS, SHIPPING CITY, SHIPPING STATE AND ZIPCODE, THANKS.

BILLING ADDRESS
BILLING CITY
BILLING STATE
BILLING ZIPCODE
CHECK BOX (IF SHIPPING ADDRESS SAME AS BILLING ADDRESS)
SHIPPING ADDRESS
SHIPPING CITY
SHIPPING STATE
SHIPPING ZIPCODE
 
A

Access Beginner

you could use an on update event on the check box for example

if me.checkbox = "-1" then

me.shipping address.value = me.billing address
me.shipping city.value = me.billingcity
me.shipping state.val...

and so on this should do the trick if it doesnt let me know
 
J

joecosmides

What we do at the company I work for is use a button instead of a
checkbox. It's a button called "Copy Address". The form this is on is
called CustomerF. The code below copies the data in the customer,
hpone, address, city, state, and zip fields of the customer (on that
same form) and inserts those values into the fields called BillTo,
BillPhone, BillAddress, etc.


On the On Click event is the following code:

Private Sub Command116_Click()
Me!BillTo = [Forms]![CustomerF].Form![Customer]
Me!BillPhone = [Forms]![CustomerF].Form![Phone]
Me!BillAddress = [Forms]![CustomerF].Form![Address]
Me!BillCity = [Forms]![CustomerF].Form![City]
Me!BillState = [Forms]![CustomerF].Form![State]
Me!BillZip = [Forms]![CustomerF].Form![Zip]
On Error GoTo Err_Refreshcmdd_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_Refreshcmdd_Click:
Exit Sub

Err_Refreshcmdd_Click:
MsgBox Err.Description
Resume Exit_Refreshcmdd_Click
End Sub
 
J

joecosmides

Also, the reason I showed you code like: Me!BillTo = [Forms]!
[CustomerF].Form![Customer]

Instead of Me!BillTo = Me!Customer is because if you happened to want
to copy data from another opened form into this form you can point it
to that open form by using the code:

Me!BillTo = [Forms]![SomeOtherForm].Form![FieldName]

Hope that helps
 
C

Carol Shu

thank you all, works great.

Access Beginner said:
you could use an on update event on the check box for example

if me.checkbox = "-1" then

me.shipping address.value = me.billing address
me.shipping city.value = me.billingcity
me.shipping state.val...

and so on this should do the trick if it doesnt let me know
 
A

Access Beginner

Joe, Good shout, didnt think about it that way, i was going for the simplest
method and after posting realised i missed my end if
 

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