display text

B

benj

I have a subform that have this fields:

ID Organ Isolate
1 Liver E. coli
2 Lung E. coli
3 Heart Salmonella

in my report, i want the field Isolate to show this: E. coli, E. coli,
Salmonella. instead of E. coli
E. coli
Salmonella

How can i do this?

Thanks!
 
B

benj

Thanks for the reply!
But am having problem with it. When i open the query with the code
fConcatChild("TM_bi_ast_ext","bsort","Sensitive2","Double",[TM_bi_ast_ext.bsort])
an error message appears as: "Compile error: Expected user-defined type, not
project", it would then highlight in yellow the:
Function fConcatChild(strChildTable As String, _
strIDName As String, _
strFldConcat As String, _
strIDType As String, _
varIDvalue As Variant) _
As String
and also highlight in black the part "db As Database" from Dim db As
Database. What did i do wrong?
TM_bi_ast_ext is the name of the many side table
bsort is the primary key of one side table
Sensitive2 is the field name to concatenate
Long id the data type, i used an autonumber as the primary key
TM_bi_ast_ext.bsort is the value on which return concatenated Quantity

I tried it using the northwind project and it worked properly.

thanks again!
 
A

Allen Browne

Could be a couple of things.

Most likely you need to add a reference to the DAO 3.6 library. Details in:
Solving Problems with Library References
at:
http://allenbrowne.com/ser-38.html

As the article explains, you also need to deselect the ADO reference, or
use:
Dim rs As DAO.Recordset
instead of just:
Dim rs As Recordset

The other part of the error message that is a bother is the reference to
"project". What is the Name of your project? If it clashes with the name of
something else, you need to rename one of them. To rename the project, open
a code window, and on the Tools menu you will see:
xxxx Properties
where xxxx is the name of your project.
That menu item lets you change the name.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

benj said:
Thanks for the reply!
But am having problem with it. When i open the query with the code
fConcatChild("TM_bi_ast_ext","bsort","Sensitive2","Double",[TM_bi_ast_ext.bsort])
an error message appears as: "Compile error: Expected user-defined type,
not
project", it would then highlight in yellow the:
Function fConcatChild(strChildTable As String, _
strIDName As String, _
strFldConcat As String, _
strIDType As String, _
varIDvalue As Variant) _
As String
and also highlight in black the part "db As Database" from Dim db As
Database. What did i do wrong?
TM_bi_ast_ext is the name of the many side table
bsort is the primary key of one side table
Sensitive2 is the field name to concatenate
Long id the data type, i used an autonumber as the primary key
TM_bi_ast_ext.bsort is the value on which return concatenated Quantity

I tried it using the northwind project and it worked properly.

thanks again!


Allen Browne said:
See:
Return a concatenated list of sub-record values
at:
http://www.mvps.org/access/modules/mdl0004.htm

The article explains how to programmatically combine the values from
multiple related records into one string.
 
B

benj

is DAO named in the References as Data Access Objects? or is it named as
something else? I couldn't find DAO so i closed Acess, uninstall DAO and
reinstall it as mentioned in your website. Still, i couldnt locate DAO so am
wondering if its named something else.

I also have renamed the project and changed "Dim rs As Recordset" to "Dim rs
As DAO.Recordset". It now shows a different error: "Compile error:
User-defined type not defined". maybe if i could check DAO, it will solve
the problem?

thanks again!

Allen Browne said:
Could be a couple of things.

Most likely you need to add a reference to the DAO 3.6 library. Details in:
Solving Problems with Library References
at:
http://allenbrowne.com/ser-38.html

As the article explains, you also need to deselect the ADO reference, or
use:
Dim rs As DAO.Recordset
instead of just:
Dim rs As Recordset

The other part of the error message that is a bother is the reference to
"project". What is the Name of your project? If it clashes with the name of
something else, you need to rename one of them. To rename the project, open
a code window, and on the Tools menu you will see:
xxxx Properties
where xxxx is the name of your project.
That menu item lets you change the name.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

benj said:
Thanks for the reply!
But am having problem with it. When i open the query with the code
fConcatChild("TM_bi_ast_ext","bsort","Sensitive2","Double",[TM_bi_ast_ext.bsort])
an error message appears as: "Compile error: Expected user-defined type,
not
project", it would then highlight in yellow the:
Function fConcatChild(strChildTable As String, _
strIDName As String, _
strFldConcat As String, _
strIDType As String, _
varIDvalue As Variant) _
As String
and also highlight in black the part "db As Database" from Dim db As
Database. What did i do wrong?
TM_bi_ast_ext is the name of the many side table
bsort is the primary key of one side table
Sensitive2 is the field name to concatenate
Long id the data type, i used an autonumber as the primary key
TM_bi_ast_ext.bsort is the value on which return concatenated Quantity

I tried it using the northwind project and it worked properly.

thanks again!


Allen Browne said:
See:
Return a concatenated list of sub-record values
at:
http://www.mvps.org/access/modules/mdl0004.htm

The article explains how to programmatically combine the values from
multiple related records into one string.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

I have a subform that have this fields:

ID Organ Isolate
1 Liver E. coli
2 Lung E. coli
3 Heart Salmonella

in my report, i want the field Isolate to show this: E. coli, E. coli,
Salmonella. instead of E. coli
E. coli
Salmonella

How can i do this?

Thanks!
 
B

benj

i found DAO as Microsoft DAO...., when i checked it, the code works perfectly!

thanks a lot for your help!

Allen Browne said:
Could be a couple of things.

Most likely you need to add a reference to the DAO 3.6 library. Details in:
Solving Problems with Library References
at:
http://allenbrowne.com/ser-38.html

As the article explains, you also need to deselect the ADO reference, or
use:
Dim rs As DAO.Recordset
instead of just:
Dim rs As Recordset

The other part of the error message that is a bother is the reference to
"project". What is the Name of your project? If it clashes with the name of
something else, you need to rename one of them. To rename the project, open
a code window, and on the Tools menu you will see:
xxxx Properties
where xxxx is the name of your project.
That menu item lets you change the name.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

benj said:
Thanks for the reply!
But am having problem with it. When i open the query with the code
fConcatChild("TM_bi_ast_ext","bsort","Sensitive2","Double",[TM_bi_ast_ext.bsort])
an error message appears as: "Compile error: Expected user-defined type,
not
project", it would then highlight in yellow the:
Function fConcatChild(strChildTable As String, _
strIDName As String, _
strFldConcat As String, _
strIDType As String, _
varIDvalue As Variant) _
As String
and also highlight in black the part "db As Database" from Dim db As
Database. What did i do wrong?
TM_bi_ast_ext is the name of the many side table
bsort is the primary key of one side table
Sensitive2 is the field name to concatenate
Long id the data type, i used an autonumber as the primary key
TM_bi_ast_ext.bsort is the value on which return concatenated Quantity

I tried it using the northwind project and it worked properly.

thanks again!


Allen Browne said:
See:
Return a concatenated list of sub-record values
at:
http://www.mvps.org/access/modules/mdl0004.htm

The article explains how to programmatically combine the values from
multiple related records into one string.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

I have a subform that have this fields:

ID Organ Isolate
1 Liver E. coli
2 Lung E. coli
3 Heart Salmonella

in my report, i want the field Isolate to show this: E. coli, E. coli,
Salmonella. instead of E. coli
E. coli
Salmonella

How can i do this?

Thanks!
 

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