Hi guys,
Im incredibly new to VB... I mean really new.
Heres my issue. I need to write some code into an AfterUpdate Event of a CheckBox that writes Billing Address information into the shipping address fields. Billing addresss are held under customer infomation, shipping address are held seperately in the Orders table. I need to copy to 5 fields (Unit, Street, City, St/Prov, Postal) and actually Write this information to those fields, if the checkbox is selected
Also if the check box is selected, I need those fields locked to prevent further updateing of the company billing address...
And if I change the billing address of the company I'd rather not have that update the Billing address in all previous orders... and I need a straight WRITE function.
OK this is what Ive done so far:
Private Sub AddCheck_Click()
Dim Locked As Boolean
If AddCheck.Value = vbChecked Then
Me.PropertyAddress = Me.PA
Me.City = Me.Cty
Me.PostalCode = Me.PC
Locked = True
Else
Locked = False
End If
Me.PropertyAddress.Locked = Locked
Me. City.Locked = Locked
Me.PostaCode = Locked
End Sub
...and in the BeforeUpdate section of the form itself i put:
Private Sub Form_BeforeUpdate(Cancel As Integer)
[Customers]![StreetAddress] = Me.SA
[Customers]![City] = Me.Cty
[Customers]![PostalCode] = Me.PC
End Sub
I'm really new at this... so maybe its somthing obvious like the declarations are in the wrong spot or somthing (though Ive tried putting it in a few places) . The problem is that the StreetAddress City and PostalCode of the Customer are NOT in this form. I need that data COPIED from their source in the Customers table and pasted into my PropertyAddress (etc) fields in this form, which is the Order form...
I'm Stuck!!!!
Thanks Guys
Im incredibly new to VB... I mean really new.
Heres my issue. I need to write some code into an AfterUpdate Event of a CheckBox that writes Billing Address information into the shipping address fields. Billing addresss are held under customer infomation, shipping address are held seperately in the Orders table. I need to copy to 5 fields (Unit, Street, City, St/Prov, Postal) and actually Write this information to those fields, if the checkbox is selected
Also if the check box is selected, I need those fields locked to prevent further updateing of the company billing address...
And if I change the billing address of the company I'd rather not have that update the Billing address in all previous orders... and I need a straight WRITE function.
OK this is what Ive done so far:
Private Sub AddCheck_Click()
Dim Locked As Boolean
If AddCheck.Value = vbChecked Then
Me.PropertyAddress = Me.PA
Me.City = Me.Cty
Me.PostalCode = Me.PC
Locked = True
Else
Locked = False
End If
Me.PropertyAddress.Locked = Locked
Me. City.Locked = Locked
Me.PostaCode = Locked
End Sub
...and in the BeforeUpdate section of the form itself i put:
Private Sub Form_BeforeUpdate(Cancel As Integer)
[Customers]![StreetAddress] = Me.SA
[Customers]![City] = Me.Cty
[Customers]![PostalCode] = Me.PC
End Sub
I'm really new at this... so maybe its somthing obvious like the declarations are in the wrong spot or somthing (though Ive tried putting it in a few places) . The problem is that the StreetAddress City and PostalCode of the Customer are NOT in this form. I need that data COPIED from their source in the Customers table and pasted into my PropertyAddress (etc) fields in this form, which is the Order form...
I'm Stuck!!!!
Thanks Guys