Pushing Value issue

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?
 
M

Marshall Barton

access said:
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.


Sounds like the check box is unbound.

If SameShipAddress is not in the table, then it is not tied
to any customer.
 
J

John W. Vinson

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?

Sounds like the ShipAddress control is unbound. What is its Control Source?
I'd also suggest explicitly referencing Me! on the assignment:

Me![ShipAddress] = Me![BillAddress]



John W. Vinson [MVP]
 
G

Guest

Thanks for the respone, I think SameShipAddress is in the table, how would I
tie it to only the one customer?

Marshall Barton said:
access said:
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.


Sounds like the check box is unbound.

If SameShipAddress is not in the table, then it is not tied
to any customer.
 
G

Guest

The control source is blank for ShipAddress. Do I need to change this?

John W. Vinson said:
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?

Sounds like the ShipAddress control is unbound. What is its Control Source?
I'd also suggest explicitly referencing Me! on the assignment:

Me![ShipAddress] = Me![BillAddress]



John W. Vinson [MVP]
 
M

Marshall Barton

Make sure the SameShipAddress check box has the
SameShipAddress field in its Control source.
--
Marsh
MVP [MS Access]

Thanks for the respone, I think SameShipAddress is in the table, how would I
tie it to only the one customer?

Marshall Barton said:
access said:
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.


Sounds like the check box is unbound.

If SameShipAddress is not in the table, then it is not tied
to any customer.
 
G

Guest

Okay, so SameShipAddress is in the Control source for the check box. I have
a [BillName] and [ShipName] separate from [BillAddress] and [ShipAddress].
The [BillName] seems to follow from record to record if I check the box.
However the [BillAddress] only stays with that one record. The code is
identical for each. Same code as below. I dont understand this stuff.
Marshall Barton said:
Make sure the SameShipAddress check box has the
SameShipAddress field in its Control source.
--
Marsh
MVP [MS Access]

Thanks for the respone, I think SameShipAddress is in the table, how would I
tie it to only the one customer?

Marshall Barton said:
access is making me crazy wrote:

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.


Sounds like the check box is unbound.

If SameShipAddress is not in the table, then it is not tied
to any customer.
 
G

Guest

Okay, so I was confused what you meant about Control Source. The fields that
were continuing to the next record were marked unbound, so I fixed that. It
is working better now! Thank you for your help.

John W. Vinson said:
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?

Sounds like the ShipAddress control is unbound. What is its Control Source?
I'd also suggest explicitly referencing Me! on the assignment:

Me![ShipAddress] = Me![BillAddress]



John W. Vinson [MVP]
 
M

Marshall Barton

What are you doing differently for Bill/Ship Name and
Bill/Ship Address?

If that change is being displayed for all customers, then
it's because the Bill Name text box is unbound. Since you
are setting the value of the text box, I am having trouble
understanding why you are overwriting the Ship values so the
next time you do this the Ship and Bill date will be the
same. I think there might be something either you or I am
missing here.

I hope you are not confused by the difference between the
field in table and the text box control on the form. It
appears that you are using the same name for both entities
and sometimes I am not sure which one you are talking about.
It might be a good idea to change the name of the text boxes
so we can eliminate the confusion in our discussion.
--
Marsh
MVP [MS Access]

Okay, so SameShipAddress is in the Control source for the check box. I have
a [BillName] and [ShipName] separate from [BillAddress] and [ShipAddress].
The [BillName] seems to follow from record to record if I check the box.
However the [BillAddress] only stays with that one record. The code is
identical for each. Same code as below. I dont understand this stuff.
Marshall Barton said:
Make sure the SameShipAddress check box has the
SameShipAddress field in its Control source.

Thanks for the respone, I think SameShipAddress is in the table, how would I
tie it to only the one customer?

:

access is making me crazy wrote:

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.


Sounds like the check box is unbound.

If SameShipAddress is not in the table, then it is not tied
to any customer.
 
J

John W. Vinson

Okay, so I was confused what you meant about Control Source. The fields that
were continuing to the next record were marked unbound, so I fixed that. It
is working better now! Thank you for your help.

Good... that is what both Marshall and I were trying to convey!

John W. Vinson [MVP]
 

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