Calling a public function from within a report?

  • Thread starter Thread starter rick
  • Start date Start date
R

rick

I have a report with a field that prints the LastName and FirstName of a
client. "Trim([LastName] & " ," & [FirstName])"
For privacy purposes I would like to print the first 2 chars of the
LastName then override remaining characters with an "*". I have written a
public function, passing the lastname.
My question is how do I call this function from within the report? I tried
in Detail Formatting and Detail Printing events but that didn't do anything.

I'm using MSAccess 2008.

Thank you for your assistance.

Rick
 
I have a report with a field that prints the LastName and FirstName of a
client. "Trim([LastName] & " ," & [FirstName])"
For privacy purposes I would like to print the first 2 chars of the
LastName then override remaining characters with an "*". I have written a
public function, passing the lastname.
My question is how do I call this function from within the report? I tried
in Detail Formatting and Detail Printing events but that didn't do anything.

I'm using MSAccess 2008.

Thank you for your assistance.

Rick

And your function is?
If you did want to use your function, (are you passing both names or
just the last name?) then as the control source of an unbound control:
=NameOfFunction([LastName],[FirstName])

This should do it without a user defined function needed.
As the control source of an unbound text control:
= Left([LastName],2) & String(Len([LastName])-2,"*") & ", " &
[FirstName]
 
Back
Top