Check Box

J

jjjimmyjam

Yo People, I want a check box on form that when checked will populate
shipping address fields with the records billing address text. The forms
record source is a select query derived from my customers table. The code in
the check box after update sub is affecting all records once checked or
unchecked in a single record, presumably because of the select query record
source. Whats the remedy? Thanks in advance!
 
D

Duane Hookom

Yo jjjimmyjam,
Don't ask the same question in multiple news groups. It's consider bad
manners and a nuisance.

Do you have some names of controls and their control sources that you could
share with us? Maybe provide the "code in the check box..." you currently
have.
 
J

jjjimmyjam

My apologies, I need help and got over anxious.

Controls Control Source
frmAddCustomer qryAddCustomer
txtBillingAddress BillingAddress
txtBillingCity BillingCity
txtBillingZip BillingZip
txtShippingAddress ShippingAddress

etc.
 
J

jjjimmyjam

If Me.Check49 = True Then
Me.txtshipingAddress = Me.txtBillingAddress
etc
Else
Me.txtShippingAddress = ""
etc
End If


End Sub
 
D

Duane Hookom

The code that you provided (did you copy and paste this in your reply) will
not apply to all records. It may look that way if txtshipingAddress is not
bound to a field in your form's record source.

My code would look more like:

If Me.chkShipSame = True Then
Me.txtShippingAddress = Me.txtBillingAddress
Me.txtShippingCity = Me.txtBillingCity
etc
Else
Me.txtShippingAddress = Null
Me.txtShippingCity = Null
etc
End If
 
J

J. Goddard

Hi -

Try using a command button instead of a checkbox. Your problem may be
due to the fact that your checkbox is an unbound control.

John
 
Top