Re: Accessing multiple fields in report function



Dan, you will need to pass all the fields from the record to your function.

If the function is called CountTrue, and you need to pass 3 fields, you
would set the Control Source of your text box to:
=CountTrue([Field1], [Field2], [Field3])

If you need the function to accept an indeterminate number of fields, you
can declare its arguments as a ParamArray. There's an example of parsing and
operating on the array parameters here:
http://allenbrowne.com/func-09.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dan Dorrough" <ddorrough@xxxxxxxxxxx> wrote in message
news:SrXyf.100730$ME5.35671@xxxxxxxxxxxxxxxxxxxxxxx
>I need to be able to access multiple fields within a VBA function called
>for
> each record of a report (MSAccess 2000). For example, suppose I wanted to
> return a string containing the names of all of the boolean fields that are
> true for each record, how could I do it? Or suppose I simply wanted a
> count
> of all of the boolean fields that are true in each record, how could I do
> that?


.



Relevant Pages

  • Re: Limiting Records with Null Only Once
    ... it with field A is not null in an append query. ... Dan ... >You can use the Validation Rule of the table to insist ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.queries)
  • Re: Changing Seek with a Null to Findfirst Method
    ... Dan ... >If you are still stuck after my last reply (parallel to ... rather than allenbrowne at mvps dot org. ... >> clause of a SQL ...
    (microsoft.public.access.formscoding)
  • Re: UPDATE table1 SET truefalsefield = -1 where key = 500; Never updates!
    ... see any error message. ... rather than allenbrowne at mvps dot org. ... > database was an Access 2.0 Database and was updated to Access 97 and ... > Most of the boolean fields were already in the Access 2.0 database. ...
    (microsoft.public.access.queries)
  • Re: Count?
    ... Dan ... >won't give the monthly figures. ... >See if Tom Ellison has understood what you are aiming to ... rather than allenbrowne at mvps dot org. ...
    (microsoft.public.access.queries)