Custom function in detail section

F

Frank

My table has a number of boolean fields. In my report, I want the detail
section to contain a string that lists only the boolean fields that are true,
but the fields themselves are not in the report. E.g., assuming the fields
are named A through E, record 1 would have a result like "A, B, E"; record 2
"B, C"; and so on.

I've written a function to generate the string. The detail section has a
textbox whose control is the function. I can't figure out how to get the
values of the boolean fields for the current record within the function.
I've tried A, Tablename!A, etc. Suggestions?
 
D

Daryl S

Frank -

[A] should work. If not, I would check to see where your function is. Is
it in a module that has public access? I assume your function call is
something like:
Public Function GetStringResult(ValA As Boolean, ValB As Boolean, ValC
As Boolean, <etc.>) As String

If so, in your report, you would use as the controlsource for your text
field something like this:
=GetStringResult([A],,[C], <etc.>)

That should give you what you want.
 
M

Marshall Barton

Frank said:
My table has a number of boolean fields. In my report, I want the detail
section to contain a string that lists only the boolean fields that are true,
but the fields themselves are not in the report. E.g., assuming the fields
are named A through E, record 1 would have a result like "A, B, E"; record 2
"B, C"; and so on.

I've written a function to generate the string. The detail section has a
textbox whose control is the function. I can't figure out how to get the
values of the boolean fields for the current record within the function.
I've tried A, Tablename!A, etc. Suggestions?


That will only generate an error. You could arrange the
report's record source query to include the fields or use
the Concatenate function at:
http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=16&SID=8zc1f82d8ab26ef73c28z158c6f47278
 

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