Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / March 2005

Tip: Looking for answers? Try searching our database.

Shipping address different from customer address

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CC - 29 Mar 2005 21:47 GMT
Hi! I'm setting up an Orders database. My users will enter the order
information using a form. Here is how I'd like it to go - please let me know
if this is possible and how I'd set it up:

1. The first thing they will enter is the customer ID. The shipping address
fields should autopopulate based on the customer ID that is entered.

2. If the shipping address is different from the default address, the user
can type in a shipping address ID in another field, and that address will
appear.

3. If the shipping address is a one-time use only and doesn't exist in a
table, then the user can manually type it into the fields.

Any help is appreciated!  Thanks so much!
C
PC Datasheet - 29 Mar 2005 22:21 GMT
You need these tables:
TblCustomer
CustomerID
CustName
CustMailingAddress
CustShippingAddress
CustCity
CustState
CustZipcode

TblOrder
OrderID
CustomerID
OrderDate
<Your other order fields>

Your Order form should be based on TblOrder. CustomerID should be entered
with a combobox named CustomerID based on TblCustomer. Put the following
code in the AfterUpdate event of the combobox:
Dim Db As DAO.Database
Dim Rst As DAO.Recordset
Set Db = CurrentDb
Set Rst = Db.OpenRecordset("TblCustomer",dbOpenDynaSet)
Rst.FindFirst "[CustomerID] = " & Me!CustomerID
With Rst
   Me!ShippingAddress = !CustShippingAddress
   Me!ShippingCity = !CustCity
   Me!ShippingState = !CustState
   Me!ShippingZipcode = !CustZipcode
End With
Rst.Close
Set Rst = Nothing
Set Db = Nothing

The above is your basic code for your Q1. You can modify this for 2 and 3.

--
                                       PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
                             resource@pcdatasheet.com
                                www.pcdatasheet.com

> Hi! I'm setting up an Orders database. My users will enter the order
> information using a form. Here is how I'd like it to go - please let me know
[quoted text clipped - 12 lines]
> Any help is appreciated!  Thanks so much!
> C
CC - 29 Mar 2005 23:31 GMT
Thanks for your help! But actually, in my situation, I have one customer who
has 68 different offices, so there are 68 possible shipping addresses. I
still need to use the same customer ID for this one customer because all
billing and tracking go to a central place.

So I'm considering creating another table that's just for Shipping
Addresses. Would I still be able to do what I want to do?

> You need these tables:
> TblCustomer
[quoted text clipped - 56 lines]
> > Any help is appreciated!  Thanks so much!
> > C
PC Datasheet - 30 Mar 2005 00:27 GMT
How about something like:

TblCustomer
CustomerID
CustomerName

TblAddressType
AddressTypeID
AddressType    (Mailing, Shipping)

TblCustAddress
CustAddressID
CustomerID
AddressTypeID
StreetAddress
City
State
Zip

--
                                       PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
                             resource@pcdatasheet.com
                                www.pcdatasheet.com

> Thanks for your help! But actually, in my situation, I have one customer who
> has 68 different offices, so there are 68 possible shipping addresses. I
[quoted text clipped - 64 lines]
> > > Any help is appreciated!  Thanks so much!
> > > C
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.