Force Table Entry (1 Viewer)

wtrimble

Registered User.
Local time
Today, 05:42
Joined
Nov 13, 2009
Messages
177
I have a form where users need to enter in Address information with 7 different controls {Street, City, State...). One control on the form is to say whether it is a "mailing or shipping" address (in a drop down).
At the end of the form I want to ask with a "Yes" or "No" button whether the Mailing and Shipping addresses are the same. If "yes" I want the information to store in the table as "mailing" and then in the next row, store the same information as "shipping".
Not sure how to do that with macros though. Do I need to use "SetValue"? Please help!
 

John Big Booty

AWF VIP
Local time
Today, 19:42
Joined
Aug 29, 2005
Messages
8,263
First up welcome to the forum.

I'm presuming this data is being stored in a customer details table.

How many addresses do you wish to store for each client? Is it just billing and mailing address, or are you wanting to store a number of alternate mailing/billing addresses?

If it's just billing and mailing address I would structure the table as follows;

ClinetID (PK)
Clinet Name
Billing Address St name
Billing Address Suburb
Billing Address State
Billing Address Postcode
Mailing address St name
Mailing address Suburb
Mailing address State
Mailing address Postcode
etc.

Then on you form you would have your check box to indicate that the billing and mailing addresses are the same, this could be unbound and default to unchecked (No), then in the On Click event of the check box put the following code;
Code:
If Me.Check Name = "True" Then
     Me.MailingAddressStName = Me.BillingAddressStName
     Me.MailingAddressSuburb = Me.BillingAddressSuburb
     Me.MailingAddressState = Me.BillingAddressState
     Me.MailingAddressPostcode = Me.BillingAddressPostcode
Else
     Me.MailingAddressStName = ""
     Me.MailingAddressSuburb = ""
     Me.MailingAddressState = ""
     Me.MailingAddressPostcode = ""
End If
 

Scooterbug

Registered User.
Local time
Today, 05:42
Joined
Mar 27, 2009
Messages
853
I use a button for that on my forms.

Code:
Me.CustBillFirstName = Me.CUST_FIRST_NAME
Me.CustBillLastName = Me.CUST_LAST_NAME
Me.BillAddress1 = Me.ADDRESS_1
Me.BillAddress2 = Me.ADDRESS_2
Me.BillCity = Me.CITY
Me.BillState = Me.STATE
Me.BillZip = Me.ZIP

make sure you substitue your control names.
 

wtrimble

Registered User.
Local time
Today, 05:42
Joined
Nov 13, 2009
Messages
177
Hey, Thanks. That's a good idea. I was trying to use two different tables for the addresses but one will do.

Thanks for the help on my first post!
 

Users who are viewing this thread

Top Bottom