Multiple recipients at one address

G

Guest

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!
 
G

Guest

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
 
G

Guest

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah
 
G

Guest

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
 
G

Guest

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


Duane Hookom said:
Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah
 
G

Guest

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


Duane Hookom said:
Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


Duane Hookom said:
Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


Duane Hookom said:
Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


Mariah said:
I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


Duane Hookom said:
Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



Duane Hookom said:
Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


Mariah said:
I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


Duane Hookom said:
Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Please reply with the SQL view of your query as well as the data types of the
significant fields.
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



Duane Hookom said:
Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


Mariah said:
I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


:

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Thank you again, Duane:

SELECT tblCustomerAddresses.[Index Name], tblCustomerAddresses.[Mail Address
1], tblCustomerAddresses.[Mail Address 2], tblCustomerAddresses.[Mail City],
tblCustomerAddresses.[Mail State], tblCustomerAddresses.[Mail Zip]
FROM tblCustomerAddresses
ORDER BY tblCustomerAddresses.[Mail Address 2], tblCustomerAddresses.[Mail
City], tblCustomerAddresses.[Mail State];

All fields are text fields. Also, I made the appropriate tweaks between
your code and my field names, etc. (I added appropriate spaces and removed
the 1 from the table name, etc so that isn't causing the error).


Duane Hookom said:
Please reply with the SQL view of your query as well as the data types of the
significant fields.
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



Duane Hookom said:
Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


:

I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


:

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Oh, I should mention that I have been deleting all the code that Access
created and replacing it with your code. I did try pasting it below what
Access created but it gets angry at me for having characters after the end of
the SQL statement.

This is so intriguing! Thank you for your assistance!


Duane Hookom said:
Please reply with the SQL view of your query as well as the data types of the
significant fields.
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



Duane Hookom said:
Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


:

I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


:

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

The SQL that you posted doesn't include the Concatenate() function. Try this
SQL
SELECT Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and ") as IndexNames ,
[Mail Address 1], [Mail Address 2], [Mail City], [Mail State], [Mail Zip]
FROM tblCustomerAddresses
GROUP BY Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and "), [Mail Address 2], [Mail City], [Mail
State];

Watch out for line wrapping issues.

--
Duane Hookom
Microsoft Access MVP


Mariah said:
Oh, I should mention that I have been deleting all the code that Access
created and replacing it with your code. I did try pasting it below what
Access created but it gets angry at me for having characters after the end of
the SQL statement.

This is so intriguing! Thank you for your assistance!


Duane Hookom said:
Please reply with the SQL view of your query as well as the data types of the
significant fields.
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



:

Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


:

I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


:

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Oh boy, we are almost there!

After lots of experimenting and working with what you said (I am a newbie) I
was able to get the query to work without errors and the system stopped
asking me to debug.

I created a report based on the query and it is concatenating the names,
however the report is making labels for every record.

For example: let's say there are three people at an address. I now have
three identical labels for that address with the concatenated names.

Is there a solution for this?

Thanks for your help!


Duane Hookom said:
The SQL that you posted doesn't include the Concatenate() function. Try this
SQL
SELECT Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and ") as IndexNames ,
[Mail Address 1], [Mail Address 2], [Mail City], [Mail State], [Mail Zip]
FROM tblCustomerAddresses
GROUP BY Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and "), [Mail Address 2], [Mail City], [Mail
State];

Watch out for line wrapping issues.

--
Duane Hookom
Microsoft Access MVP


Mariah said:
Oh, I should mention that I have been deleting all the code that Access
created and replacing it with your code. I did try pasting it below what
Access created but it gets angry at me for having characters after the end of
the SQL statement.

This is so intriguing! Thank you for your assistance!


Duane Hookom said:
Please reply with the SQL view of your query as well as the data types of the
significant fields.
--
Duane Hookom
Microsoft Access MVP


:

Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



:

Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


:

I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


:

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Yes, there is a "solution for this". It begins with you posting the SQL view
of your report's records source. I expect you only need to make your query
into a group by /totals query.
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Oh boy, we are almost there!

After lots of experimenting and working with what you said (I am a newbie) I
was able to get the query to work without errors and the system stopped
asking me to debug.

I created a report based on the query and it is concatenating the names,
however the report is making labels for every record.

For example: let's say there are three people at an address. I now have
three identical labels for that address with the concatenated names.

Is there a solution for this?

Thanks for your help!


Duane Hookom said:
The SQL that you posted doesn't include the Concatenate() function. Try this
SQL
SELECT Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and ") as IndexNames ,
[Mail Address 1], [Mail Address 2], [Mail City], [Mail State], [Mail Zip]
FROM tblCustomerAddresses
GROUP BY Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and "), [Mail Address 2], [Mail City], [Mail
State];

Watch out for line wrapping issues.

--
Duane Hookom
Microsoft Access MVP


Mariah said:
Oh, I should mention that I have been deleting all the code that Access
created and replacing it with your code. I did try pasting it below what
Access created but it gets angry at me for having characters after the end of
the SQL statement.

This is so intriguing! Thank you for your assistance!


:

Please reply with the SQL view of your query as well as the data types of the
significant fields.
--
Duane Hookom
Microsoft Access MVP


:

Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



:

Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


:

I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


:

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Thanks again for your assistance! Could you also recommend any manuals that
I could read or reference that would help me learn this language?

SELECT tblCustomerAddresses.IndexName, tblCustomerAddresses.CustomerType,
tblCustomerAddresses.MailAddress1, tblCustomerAddresses.MailAddress2,
tblCustomerAddresses.MailCity, tblCustomerAddresses.MailState,
tblCustomerAddresses.MailZip, Concatenate("SELECT [IndexName] FROM
tblCustomerAddresses WHERE MailAddress1 & MailAddress2 & MailCity & MailState
& MailZip =""" & [MailAddress1] & [MailAddress2] & [MailCity] & [MailState] &
[MailZip] & """",", ") AS Concat
FROM tblCustomerAddresses
WHERE (((tblCustomerAddresses.CustomerType)="Sister" Or
(tblCustomerAddresses.CustomerType)="Associate"))
ORDER BY tblCustomerAddresses.IndexName, tblCustomerAddresses.MailAddress2,
tblCustomerAddresses.MailCity, tblCustomerAddresses.MailState;

Duane Hookom said:
Yes, there is a "solution for this". It begins with you posting the SQL view
of your report's records source. I expect you only need to make your query
into a group by /totals query.
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Oh boy, we are almost there!

After lots of experimenting and working with what you said (I am a newbie) I
was able to get the query to work without errors and the system stopped
asking me to debug.

I created a report based on the query and it is concatenating the names,
however the report is making labels for every record.

For example: let's say there are three people at an address. I now have
three identical labels for that address with the concatenated names.

Is there a solution for this?

Thanks for your help!


Duane Hookom said:
The SQL that you posted doesn't include the Concatenate() function. Try this
SQL
SELECT Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and ") as IndexNames ,
[Mail Address 1], [Mail Address 2], [Mail City], [Mail State], [Mail Zip]
FROM tblCustomerAddresses
GROUP BY Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and "), [Mail Address 2], [Mail City], [Mail
State];

Watch out for line wrapping issues.

--
Duane Hookom
Microsoft Access MVP


:

Oh, I should mention that I have been deleting all the code that Access
created and replacing it with your code. I did try pasting it below what
Access created but it gets angry at me for having characters after the end of
the SQL statement.

This is so intriguing! Thank you for your assistance!


:

Please reply with the SQL view of your query as well as the data types of the
significant fields.
--
Duane Hookom
Microsoft Access MVP


:

Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



:

Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


:

I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


:

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Try this query
SELECT MailAddress1, MailAddress2,
MailCity, MailState, MailZip,
Concatenate("SELECT [IndexName] FROM tblCustomerAddresses WHERE MailAddress1
& MailAddress2 & MailCity & MailState & MailZip =""" & [MailAddress1] &
[MailAddress2] & [MailCity] & [MailState] & [MailZip] & """",", ") AS Concat
FROM tblCustomerAddresses
WHERE CustomerType IN ("Sister","Associate")
GROUP BY MailAddress1, MailAddress2,
MailCity, MailState, MailZip,
Concatenate("SELECT [IndexName] FROM tblCustomerAddresses WHERE MailAddress1
& MailAddress2 & MailCity & MailState & MailZip =""" & [MailAddress1] &
[MailAddress2] & [MailCity] & [MailState] & [MailZip] & """",", ")
ORDER BY MailAddress2, MailCity, MailState;

--
Duane Hookom
Microsoft Access MVP


Mariah said:
Thanks again for your assistance! Could you also recommend any manuals that
I could read or reference that would help me learn this language?

SELECT tblCustomerAddresses.IndexName, tblCustomerAddresses.CustomerType,
tblCustomerAddresses.MailAddress1, tblCustomerAddresses.MailAddress2,
tblCustomerAddresses.MailCity, tblCustomerAddresses.MailState,
tblCustomerAddresses.MailZip, Concatenate("SELECT [IndexName] FROM
tblCustomerAddresses WHERE MailAddress1 & MailAddress2 & MailCity & MailState
& MailZip =""" & [MailAddress1] & [MailAddress2] & [MailCity] & [MailState] &
[MailZip] & """",", ") AS Concat
FROM tblCustomerAddresses
WHERE (((tblCustomerAddresses.CustomerType)="Sister" Or
(tblCustomerAddresses.CustomerType)="Associate"))
ORDER BY tblCustomerAddresses.IndexName, tblCustomerAddresses.MailAddress2,
tblCustomerAddresses.MailCity, tblCustomerAddresses.MailState;

Duane Hookom said:
Yes, there is a "solution for this". It begins with you posting the SQL view
of your report's records source. I expect you only need to make your query
into a group by /totals query.
--
Duane Hookom
Microsoft Access MVP


Mariah said:
Oh boy, we are almost there!

After lots of experimenting and working with what you said (I am a newbie) I
was able to get the query to work without errors and the system stopped
asking me to debug.

I created a report based on the query and it is concatenating the names,
however the report is making labels for every record.

For example: let's say there are three people at an address. I now have
three identical labels for that address with the concatenated names.

Is there a solution for this?

Thanks for your help!


:

The SQL that you posted doesn't include the Concatenate() function. Try this
SQL
SELECT Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and ") as IndexNames ,
[Mail Address 1], [Mail Address 2], [Mail City], [Mail State], [Mail Zip]
FROM tblCustomerAddresses
GROUP BY Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and "), [Mail Address 2], [Mail City], [Mail
State];

Watch out for line wrapping issues.

--
Duane Hookom
Microsoft Access MVP


:

Oh, I should mention that I have been deleting all the code that Access
created and replacing it with your code. I did try pasting it below what
Access created but it gets angry at me for having characters after the end of
the SQL statement.

This is so intriguing! Thank you for your assistance!


:

Please reply with the SQL view of your query as well as the data types of the
significant fields.
--
Duane Hookom
Microsoft Access MVP


:

Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



:

Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


:

I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


:

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?

I have queried a mailing but in order to conserve funds the members only
want one sent when they are at a single address. At the same time I have to
keep them as unique entries because we keep track of birthdays, etc.

We would like to keep the names on the labels of the members who live alone.

Any help is appreciated.
 
G

Guest

Oh glory be! it works!!! YAY!! Thank you SO MUCH!!!!

Now I will have to study this and figure out what makes it tick so I can do
this on my own for other projects like letters :) :) :)

THANK YOU!!!!


Duane Hookom said:
Try this query
SELECT MailAddress1, MailAddress2,
MailCity, MailState, MailZip,
Concatenate("SELECT [IndexName] FROM tblCustomerAddresses WHERE MailAddress1
& MailAddress2 & MailCity & MailState & MailZip =""" & [MailAddress1] &
[MailAddress2] & [MailCity] & [MailState] & [MailZip] & """",", ") AS Concat
FROM tblCustomerAddresses
WHERE CustomerType IN ("Sister","Associate")
GROUP BY MailAddress1, MailAddress2,
MailCity, MailState, MailZip,
Concatenate("SELECT [IndexName] FROM tblCustomerAddresses WHERE MailAddress1
& MailAddress2 & MailCity & MailState & MailZip =""" & [MailAddress1] &
[MailAddress2] & [MailCity] & [MailState] & [MailZip] & """",", ")
ORDER BY MailAddress2, MailCity, MailState;

--
Duane Hookom
Microsoft Access MVP


Mariah said:
Thanks again for your assistance! Could you also recommend any manuals that
I could read or reference that would help me learn this language?

SELECT tblCustomerAddresses.IndexName, tblCustomerAddresses.CustomerType,
tblCustomerAddresses.MailAddress1, tblCustomerAddresses.MailAddress2,
tblCustomerAddresses.MailCity, tblCustomerAddresses.MailState,
tblCustomerAddresses.MailZip, Concatenate("SELECT [IndexName] FROM
tblCustomerAddresses WHERE MailAddress1 & MailAddress2 & MailCity & MailState
& MailZip =""" & [MailAddress1] & [MailAddress2] & [MailCity] & [MailState] &
[MailZip] & """",", ") AS Concat
FROM tblCustomerAddresses
WHERE (((tblCustomerAddresses.CustomerType)="Sister" Or
(tblCustomerAddresses.CustomerType)="Associate"))
ORDER BY tblCustomerAddresses.IndexName, tblCustomerAddresses.MailAddress2,
tblCustomerAddresses.MailCity, tblCustomerAddresses.MailState;

Duane Hookom said:
Yes, there is a "solution for this". It begins with you posting the SQL view
of your report's records source. I expect you only need to make your query
into a group by /totals query.
--
Duane Hookom
Microsoft Access MVP


:

Oh boy, we are almost there!

After lots of experimenting and working with what you said (I am a newbie) I
was able to get the query to work without errors and the system stopped
asking me to debug.

I created a report based on the query and it is concatenating the names,
however the report is making labels for every record.

For example: let's say there are three people at an address. I now have
three identical labels for that address with the concatenated names.

Is there a solution for this?

Thanks for your help!


:

The SQL that you posted doesn't include the Concatenate() function. Try this
SQL
SELECT Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and ") as IndexNames ,
[Mail Address 1], [Mail Address 2], [Mail City], [Mail State], [Mail Zip]
FROM tblCustomerAddresses
GROUP BY Concatenate("SELECT [Index Name] FROM tblCustomerAddresses
WHERE [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail State] &
[Mail Zip] = """ & [Mail Address 1] & [Mail Address 2] & [Mail City] & [Mail
State] & [Mail Zip] & """", " and "), [Mail Address 2], [Mail City], [Mail
State];

Watch out for line wrapping issues.

--
Duane Hookom
Microsoft Access MVP


:

Oh, I should mention that I have been deleting all the code that Access
created and replacing it with your code. I did try pasting it below what
Access created but it gets angry at me for having characters after the end of
the SQL statement.

This is so intriguing! Thank you for your assistance!


:

Please reply with the SQL view of your query as well as the data types of the
significant fields.
--
Duane Hookom
Microsoft Access MVP


:

Thanks Duane, I am learning something new at every turn!

I now have the module from the sample saved within my database as a new
module named "modStringFunctions". However, I am still getting the error
even after closing out of Access and re-opening the program and the database.


Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.


I appreciate all your help and I hope you are still interested in helping me
crack this thing...



:

Do you have a standard module in your MDB that contains the Concatenate()
function? If not, import the one from the sample or copy and paste the
function code into a new or existing module. Make sure the name of the module
is not the name of any function. IOW, name your module something like
"modStringFunctions".

--
Duane Hookom
Microsoft Access MVP


:

I copied the code you posted into the SQL view for the query and double
checked that all references to tables/fields/etc were correct...

A box pops up and it says:
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'.

Thank you again for your patience and your assistance.


:

Did you copy the module with the concatenate function into your mdb?
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane,

Thank you so much for your help. I have been working with this since you
posted the resolution to my problem because I want to figure this out but I
still can't get it to work. I am getting an error:

"Undefined function 'Concatenate' in expression." When I got this error I
figured if it didn't want "concatenate" then there must be another word it is
looking for but I can't find the answer to that.

I am using Access 2003, could this be an issue?

Thanks for your help and Happy Labor Day!


:

Your concatenate function might look something like:
Concatenate("SELECT [Index Name] FROM tbl1CustomerAddresses WHERE
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip =""" &
MailAddress1 & MailAddress2 & MailCity & MailState & MailZip & """", " And ")
--
Duane Hookom
Microsoft Access MVP


:

Hi Duane, Thank you for your patience and expertise!

Here is the information:

Table Name:
tbl1CustomerAddresses

Field Names:
CustomerID (Auto-generated primary key #)
Index Name
MailAddress1
MailAddress2
MailCity
MailState
MailZip

4 Records with Field Entry Examples (notice repeat addresses):
Index Name: Mr. John Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Mrs. Jane Doe
Mail Address 1: The Arte Shoppe
Mail Address 2: 5555 55th St.
MailCity: Chicago
MailState: IL
MailZip: 55555

Index Name: Ms. Amy White
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222

Index Name: Mary Smith
Mail Address 1:
Mail Address 2: 1111 Elm Street
MailCity: Phoenix
MailState: AZ
MailZip: 22222


Sample Address Label:
Index Name
Mail Address 1
Mail Address 2
Mail City, MailState MailZip

For example:
Ms. Amy White and Mary Smith
1111 Elm Street
Phoenix, AZ 22222


Thanks again for your help, it will keep my head from rolling!!

Mariah



:

The generic concatenate function could be used. The SQL statement in the
concatenate() function would be something like:
Concatenate("SELECT FirstName FROM tblSomeName WHERE Address=""" & Address &
""" AND City = """ & City & """", ",")

If you can't figure this out, come back with signficant table and field
names as well as sample data and how you want these to appear on your labels.
--
Duane Hookom
Microsoft Access MVP


:

Thank you for this example, but I am still having trouble... It could be
that I am simply not understanding the example.

More information:
The members move around so they aren't static like a family would be - some
change addresses and move to different houses and roomates many times a year.
I have each one in a single record and would like to merge based only on the
addresses, that way I only need update the address when it is submitted
rather than trying to refigure subforms, etc.

Is this even possible?

Thanks again for your help, your replies to other users questions have made
my database so much better then it was!


:

There is a generic concatenate function with usage at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane. You could
use this to concatenate based on address.
--
Duane Hookom
Microsoft Access MVP


:

Is there a way to tell the database to print a different header for an
address label if there are multiple members at the same address?
 

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