Autofill ship to/bill to fields

E

Eric Curry

I'm wanting to create an invoicing system in a database
that I have and have the need to send the items to a
different address than was billed to.
How do I set up the form so once I've entered the ship to
info, I can just check a box or a button to autofill the
bill to address (or vice versa).
thanks
 
T

Tim Ferguson

I can just check a box or a button to autofill the
bill to address (or vice versa).

If you only want one button, it could go like this:-


if IsNull(me!BillingAddressID) then
me!BillingAddressID = me!ShippingAddressID

elseif IsNull(me!ShippingAddressID) Then
me!ShippingAddressID = me!BillingAddressID

else ' neither is empty: stupid user!
beep

end if



.... or you could have two buttons, one for L-R and the other goes R-L.

Hope that helps


Tim F
 
T

Tim Ferguson

And where would I insert this code and how do I reference
it on the form?

If you want to do it with a command button (or two), you put it in the On
Click event (or events); for a checkbox, you could use the On Change or the
AfterUpdate event.

If you are dipping into VBA and event-driven programming for the first
time, you could do worse than to browse the help files and look at the
examples in Northwind.mdb; and/ or invest in a book that specifies
programming solutions in Access. There is a significant learning curve to
get to grips with programming, but well worth the effort if you want to
develop databases that are more help to the users than hindrance.

Best wishes


Tim F
 
E

eric Curry

Thank you very much!
e


-----Original Message-----


If you want to do it with a command button (or two), you put it in the On
Click event (or events); for a checkbox, you could use the On Change or the
AfterUpdate event.

If you are dipping into VBA and event-driven programming for the first
time, you could do worse than to browse the help files and look at the
examples in Northwind.mdb; and/ or invest in a book that specifies
programming solutions in Access. There is a significant learning curve to
get to grips with programming, but well worth the effort if you want to
develop databases that are more help to the users than hindrance.

Best wishes


Tim F

.
 

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