Solved Copy info (1 Viewer)

sctb0825

Member
Local time
Today, 04:41
Joined
Dec 28, 2021
Messages
53
I have on my customer form;

Customer Name Remit To
Address Address
Address 2 Address 2
City City
St ST
Zip Zip

I want to have a copy button so in the event that the remit to is the same as the Customer information they can just click the copy button and it fills in the remit to column.

any advise on how to do this.
 

June7

AWF VIP
Local time
Today, 03:41
Joined
Mar 9, 2014
Messages
5,474
The RemitTo column would hold all address parts?

Could just save word "SAME". Otherwise, concatenate.
 

sctb0825

Member
Local time
Today, 04:41
Joined
Dec 28, 2021
Messages
53
The remit to is on a different page in a tabbed form
 

June7

AWF VIP
Local time
Today, 03:41
Joined
Mar 9, 2014
Messages
5,474
If this is a Tab control, doesn't matter that it is on another page. Is it in a subform?
 

sctb0825

Member
Local time
Today, 04:41
Joined
Dec 28, 2021
Messages
53
If this is a Tab control, doesn't matter that it is on another page. Is it in a subform?
not a subform, but I want it to fill in the remit to information. how do I do a copy command
 

June7

AWF VIP
Local time
Today, 03:41
Joined
Mar 9, 2014
Messages
5,474
It is not a copy command, it is simply concatenating fields and saving the result to another field. If there is only one field for the remittance addres and you want complete address in there.

Me!RemitTo = Address & vbCrLf & Address2 & vbCrLf & City & vbCrLf & ST & vbCrLf & Zip

But if your OP is actually showing two sets of address fields, there can't be two fields named Address, etc.
Code:
With Me
!RemitTo = !CustomerName
!RemittanceAddress = !CustomerAddress
etc...
End With

Strongly advise not to use spaces in naming convention.
 
Last edited:

oleronesoftwares

Passionate Learner
Local time
Today, 04:41
Joined
Sep 22, 2014
Messages
1,159
@sctb0825 you can place the expression suggested by @June7 into the after update event of RemitTo field.

If you can upload images of the form, it will give more clarity.
 

June7

AWF VIP
Local time
Today, 03:41
Joined
Mar 9, 2014
Messages
5,474
@oleronesoftwares, why AfterUpdate of RemitTo field? That would write over any input by user. OP wants to use a button so code goes in Click event.
 

oleronesoftwares

Passionate Learner
Local time
Today, 04:41
Joined
Sep 22, 2014
Messages
1,159
@June7 am referring to the second remit to column, i,e the one on the customer information

Modified,
On click event of the Command button.

It will be put inside an if statement .
 

moke123

AWF VIP
Local time
Today, 07:41
Joined
Jan 11, 2013
Messages
3,920
Following what you see on numerous websites, I would have a checkbox with "Remittance Address Same as Customer Address"
Then in code use the customer address if true or whatever is entered if false.
 

sctb0825

Member
Local time
Today, 04:41
Joined
Dec 28, 2021
Messages
53
Here is a screenshot of what I am doing.

some of my customers use a factoring company, some have a different mailing address that is the purpose for this form.
as you can see it is a tabbed form the customer info is on the 1st tab the remit to info is on the second tab.

I would like a button or something on this page to fill in the left side if the remit to address is the same as the customer information on the 1st page.
 

Attachments

  • Database-17.jpg
    Database-17.jpg
    37 KB · Views: 209

moke123

AWF VIP
Local time
Today, 07:41
Joined
Jan 11, 2013
Messages
3,920
In your Factor code combobox include all the info you need on the factoring company but set the column widths to only show what you need to see. In the after update of the combobox fill in your form fields.

Code:
Me.Company = me.YourComboBoxName.Column(1)
me.Address = me.YourComboBoxName.Column(2)
me.Address2 = me.YourComboBoxName.Column(3)
etc,
etc,

Same if you use a checkbox to use customer address. After update and set your fields to the customer address.
 

sctb0825

Member
Local time
Today, 04:41
Joined
Dec 28, 2021
Messages
53
In your Factor code combobox include all the info you need on the factoring company but set the column widths to only show what you need to see. In the after update of the combobox fill in your form fields.

Code:
Me.Company = me.YourComboBoxName.Column(1)
me.Address = me.YourComboBoxName.Column(2)
me.Address2 = me.YourComboBoxName.Column(3)
etc,
etc,

Same if you use a checkbox to use customer address. After update and set your fields to the customer address.
I have the Factor side working and it autofills as I need it to, it is the left side I need a to have a copy or fill in the event that the remit to is the same as the company information on the Carrier Info page
 

moke123

AWF VIP
Local time
Today, 07:41
Joined
Jan 11, 2013
Messages
3,920
Same concept.
On whatever event you use:

Code:
Me.CarrierName = Me.CompanyName
Me.RemitTo Address = Me.CompanyAddress
etc.

Obviously use whatever your control names are for those fields.
you should be able to use the Me. keyword if the fields are on a different tab of the tab control.

example:
 

Attachments

  • Database2.accdb
    408 KB · Views: 255
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:41
Joined
Feb 19, 2002
Messages
43,293
I don't use the checkbox concept although I don't object to it. I just think it leads to unnecessary complications. Instead, I "assume" the address will be the same and simply copy the saved address to the second set of boxes when the record is created. Then the user can overwrite them as necessary.

Using the checkbox method, I would probably copy the address in the BeforeUpdate event after first checking to ensure that the "to" address is still null. If it isn't, now you have to ask the user to confirm because maybe he checked the box but then changed his mind and entered an address. If you don't do the copy at that time but instead leave it for later, you run into the problem of the "original" address ending up being changed and so later that would also affect the "empty" "to" address.

Once you allow two sets of fields in the table, you aren't saving anything by not filling the second set as soon as possible.

Whenever there are two fields that can conflict, you complicate your process and that is why I don't use the checkbox method.
 

sctb0825

Member
Local time
Today, 04:41
Joined
Dec 28, 2021
Messages
53
I was thinking of a button that just say Copy Carrier or Copy Primary
 

sctb0825

Member
Local time
Today, 04:41
Joined
Dec 28, 2021
Messages
53
Thanks for all the great help. I have it working with a Text Box on Click
 

Users who are viewing this thread

Top Bottom