Access Code Pushing Values

G

Guest

I have a customer database with [BillAddress] and [ShipAddress]. I am using
a "yes/no" box titled[SameShipAddress?]. To automatically fill [ShipAddress]
after checking the "yes/no" box I used this code in the after update event
for the check box.

If Me![SameShipAddress?] Then
If IsNull(Me![BillAddress]) Then

Else
[ShipAddress] = [BillAddress]
End If
End If

This works for the selected customer, but then pushes the entry
[BillAddress] of the previous customer to [ShipAddress] of all of the
following customers.

Any thoughts?
 
D

Douglas J. Steele

Sounds as though you're talking about an unbound control on your form.

Unfortunately, that's how they work.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"access is making me crazy"
 
G

Guest

Am I going about it with the wrong method? Can you think of a way to limit
the entry just to the one record and have the next record be an empty slate?
Douglas J. Steele said:
Sounds as though you're talking about an unbound control on your form.

Unfortunately, that's how they work.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"access is making me crazy"
I have a customer database with [BillAddress] and [ShipAddress]. I am
using
a "yes/no" box titled[SameShipAddress?]. To automatically fill
[ShipAddress]
after checking the "yes/no" box I used this code in the after update event
for the check box.

If Me![SameShipAddress?] Then
If IsNull(Me![BillAddress]) Then

Else
[ShipAddress] = [BillAddress]
End If
End If

This works for the selected customer, but then pushes the entry
[BillAddress] of the previous customer to [ShipAddress] of all of the
following customers.

Any thoughts?
 
D

Douglas J. Steele

Try setting the control source of the field to

=([SameShipAddress?], [BillAddress], [ShipAddress])

(including the equal sign)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"access is making me crazy"
Am I going about it with the wrong method? Can you think of a way to limit
the entry just to the one record and have the next record be an empty
slate?
Douglas J. Steele said:
Sounds as though you're talking about an unbound control on your form.

Unfortunately, that's how they work.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"access is making me crazy"
I have a customer database with [BillAddress] and [ShipAddress]. I am
using
a "yes/no" box titled[SameShipAddress?]. To automatically fill
[ShipAddress]
after checking the "yes/no" box I used this code in the after update
event
for the check box.

If Me![SameShipAddress?] Then
If IsNull(Me![BillAddress]) Then

Else
[ShipAddress] = [BillAddress]
End If
End If

This works for the selected customer, but then pushes the entry
[BillAddress] of the previous customer to [ShipAddress] of all of the
following customers.

Any thoughts?
 
G

Guest

Thank you for the response and trying to help. which field should I set the
control source for? I tried [ShipAddress] and it came back with a circular
reference error.

Douglas J. Steele said:
Try setting the control source of the field to

=([SameShipAddress?], [BillAddress], [ShipAddress])

(including the equal sign)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"access is making me crazy"
Am I going about it with the wrong method? Can you think of a way to limit
the entry just to the one record and have the next record be an empty
slate?
Douglas J. Steele said:
Sounds as though you're talking about an unbound control on your form.

Unfortunately, that's how they work.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"access is making me crazy"
I have a customer database with [BillAddress] and [ShipAddress]. I am
using
a "yes/no" box titled[SameShipAddress?]. To automatically fill
[ShipAddress]
after checking the "yes/no" box I used this code in the after update
event
for the check box.

If Me![SameShipAddress?] Then
If IsNull(Me![BillAddress]) Then

Else
[ShipAddress] = [BillAddress]
End If
End If

This works for the selected customer, but then pushes the entry
[BillAddress] of the previous customer to [ShipAddress] of all of the
following customers.

Any thoughts?
 
D

Douglas J. Steele

Rename the text box from ShipAddress to, say, txtShipAddress

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


"access is making me crazy"
Thank you for the response and trying to help. which field should I set
the
control source for? I tried [ShipAddress] and it came back with a
circular
reference error.

Douglas J. Steele said:
Try setting the control source of the field to

=([SameShipAddress?], [BillAddress], [ShipAddress])

(including the equal sign)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"access is making me crazy"
Am I going about it with the wrong method? Can you think of a way to
limit
the entry just to the one record and have the next record be an empty
slate?
:

Sounds as though you're talking about an unbound control on your form.

Unfortunately, that's how they work.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"access is making me crazy"
I have a customer database with [BillAddress] and [ShipAddress]. I
am
using
a "yes/no" box titled[SameShipAddress?]. To automatically fill
[ShipAddress]
after checking the "yes/no" box I used this code in the after update
event
for the check box.

If Me![SameShipAddress?] Then
If IsNull(Me![BillAddress]) Then

Else
[ShipAddress] = [BillAddress]
End If
End If

This works for the selected customer, but then pushes the entry
[BillAddress] of the previous customer to [ShipAddress] of all of
the
following customers.

Any thoughts?
 
G

Guest

I think I have this figured out, thanks for the help!!

Douglas J. Steele said:
Sounds as though you're talking about an unbound control on your form.

Unfortunately, that's how they work.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


"access is making me crazy"
I have a customer database with [BillAddress] and [ShipAddress]. I am
using
a "yes/no" box titled[SameShipAddress?]. To automatically fill
[ShipAddress]
after checking the "yes/no" box I used this code in the after update event
for the check box.

If Me![SameShipAddress?] Then
If IsNull(Me![BillAddress]) Then

Else
[ShipAddress] = [BillAddress]
End If
End If

This works for the selected customer, but then pushes the entry
[BillAddress] of the previous customer to [ShipAddress] of all of the
following customers.

Any thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top