Function in Control Source with Param

  • Thread starter Thread starter Stu
  • Start date Start date
S

Stu

I have defined a function: Function iFileCount(sID as string) as integer

If I put the following into the control source of an unbound report field
the function works fine: =iFileCount("9999")

Question: Is there a way to make the sID parameter a variable that is
another field on the current record of the report? Such as
=iFileCount(me.IDField). Or some other way maybe bu using a query and/or
sub-report?

Tnx
 
Duh, thanks much. That was it!


Ken Snell said:
=iFileCount([IDField])

Put the name of the field in [ ] characters.
--

Ken Snell
http://www.accessmvp.com/KDSnell/




Stu said:
I have defined a function: Function iFileCount(sID as string) as integer

If I put the following into the control source of an unbound report field
the function works fine: =iFileCount("9999")

Question: Is there a way to make the sID parameter a variable that is
another field on the current record of the report? Such as
=iFileCount(me.IDField). Or some other way maybe bu using a query and/or
sub-report?

Tnx


.
 
Stu said:
Duh, thanks much. That was it!


Ken Snell said:
=iFileCount([IDField])

Put the name of the field in [ ] characters.

Actually, the [ ] don't matter in this case. The brackets
are only needed when a name contains non alphanumeric
characters (and when used in a Conditional Formatting
expression.)

It was the Me that was causing the problem. Me is only
valid in a VBA class module.
 
Back
Top