I have a Client info form that has the following fields:
Mailing Address1
Mailing Address2
Mailing City
Mailing State
Mailing Zip
Physical Address1
Physical Address2
Physical City
Physical State
Physical Zip
I have a yes/no checkbox titled Same As Mailing.
The idea is that when the Same As Mailing box is checked, Access will pull the data from the mailing address fields and place in the physical address fields. I am attempting to accomplish this using an If Then statement on the checkbox's click event.
I go it to populate, but not unpopulated when the box was unchecked. So I added an Else If to show the Physical fields null if the checkbox was = to false.
Then the code started getting errors. I have tracked it to my Mailing/Physical State fields, as they are combo boxes so that the user can select the state abbreviation (I know that I can't remember all of them). I have tried the Microsoft help and it tries to explain it, but I'm not getting anywhere.
Here's the code I've got:
Private Sub Same_As_Mailing_Click()
Dim sMailadd1 As String
Dim sMailadd2 As String
Dim sMailcity As String
Dim cbxMailstate As ComboBox
Dim sMailzip As String
Dim bSame As Boolean
sMailadd1 = Me.Mailing_Address1.Value
sMailadd1 = Me.Mailing_Address2.Value
sMailcity = Me.Mailing_City.Value
Set cbxMailstate = Me.Mailing_State.Column(1)
sMailzip = Me.Mailing_Zip.Value
If bSame = True Then
Me.Physical_Address1 = sMailadd1
Me.Physical_Address2 = sMailadd2
Me.Physical_City = sMailcity
Me.Physical_State = cbxMailstate
Me.Physical_Zip = sMailzip
End If
End Sub help would be greatly appreciated.
Any