Custom function in detail section

  • Thread starter Thread starter Frank
  • Start date Start date
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?
 
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.
 
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
 
Back
Top