Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

User function in access 2010 report

$
0
0
I thought I knew something about Access and functions but obviously I don't know enough!
Very simple report, printing all the addresses in a database
Rather than concatenating the first name and surname and all the lines of the address in the control source box I thought I'd have a function or two to make it simpler.
So I have:

Function CallMe()
CallMe = Trim$([Surname] & " " & IIf(IsNull(Fornames$), "", Trim$(Forname$)))
End Function

Then I try to set a text box source to =CallMe() and
When I try print preview I get the oh so helpful #Error

I've tried Me.[Surname] etc with the same result

I thought all fields in the current record were available in functions.


What has me even more puzzled is that whilst trying this out I rewrote it passing Surname as a parameter and SOMETIMES I could access Fornames without passing it and sometimes I could not.

Please someone tell me what I'm overlooking.
Thanks

Viewing all articles
Browse latest Browse all 13329

Trending Articles