"Badroy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)
> I am fairly new to access so I am guessing that functions can be
> defined in modules.
Right. I'd suggest storing the NoCR() function in a standard module,
probably one that you create (or have already created) for the purpose
of holding various utility procedures. One point to remember, if you're
not familiar with modules and VBA, is that the name of the module must
not be the same as that of any of the functions it contains. Give the
module its own, unique name.
> Since I get this error in multiple data fields
> (mostly text related) would I do this in the query?
>
> SELECT
> NoCR(FirstName),
> NoCR(LastName),
> NoCR(Address),
> NoCR(City),
> State,
> NoCR(Zip)
> FROM
> YourTable;
Yes, though I see I failed to suggest an alias for the new calculated
field. If you don't want these fields to show up in your queries as
"Expr0001", "Expr0002", and so on, you'd best provide names for them;
e.g.,
SELECT
NoCR(YourTable.FirstName) As FirstName,
NoCR(YourTable.LastName) As LastName,
NoCR(YourTable.Address) As Address,
NoCR(YourTable.City) As City ,
State,
NoCR(YourTable.Zip) As Zip
FROM
YourTable;
Note that I added the "YourTable." qualifiers so that I could reuse the
same name without confusing the SQL engine with an apparently circular
reference.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)