TonyVelasco
New member
- Local time
- Today, 15:02
- Joined
- Jan 9, 2004
- Messages
- 8
Re-posting this here instead of in the reports forum. Not sure where is the best place to ask this, but here goes!
Here is what I am trying to accomplish:
I need to print mailing labels, using a report. However, I have two different sets of addresses in each record of my table. The first address is the street address of the company. The second address is the mailing address. There is an Address, City, State, And Zip field for each address, and also mailing address fields simply named MailingAddress, MailingCity, etc...
What I want to do is have a button on a form that when clicked, prints out the mailing labels, using the main address if there is no mailing address, but using the mailing address if it exists.
What do you think would be the best way to accomplish this? Do I call two queries from an if then, and if so, what would the syntax of all this look like? Do I somehow merge the data from the address fields and the mailing address fields together into a query or temporary table, something like LabelAddresses? Then have fields in it that are either the main address or mailing address, depending on the criteria for the query?
Some advice on the cleanest, quickest way to do this would be greatly appreciated! Also, any code examples for my button would be helpful too!
This post is about vba coding, queries, and reports, along with a form button, so who knows where it should best be posted?!?!
Here is what I am trying to accomplish:
I need to print mailing labels, using a report. However, I have two different sets of addresses in each record of my table. The first address is the street address of the company. The second address is the mailing address. There is an Address, City, State, And Zip field for each address, and also mailing address fields simply named MailingAddress, MailingCity, etc...
What I want to do is have a button on a form that when clicked, prints out the mailing labels, using the main address if there is no mailing address, but using the mailing address if it exists.
What do you think would be the best way to accomplish this? Do I call two queries from an if then, and if so, what would the syntax of all this look like? Do I somehow merge the data from the address fields and the mailing address fields together into a query or temporary table, something like LabelAddresses? Then have fields in it that are either the main address or mailing address, depending on the criteria for the query?
Some advice on the cleanest, quickest way to do this would be greatly appreciated! Also, any code examples for my button would be helpful too!
This post is about vba coding, queries, and reports, along with a form button, so who knows where it should best be posted?!?!