[AccessD] Ambiguous Nmae in Query Expression

Kaup, Chester Chester_Kaup at kindermorgan.com
Thu Apr 13 09:38:10 CDT 2006


Good ideas. Made the changes. Still get the error message.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart
McLachlan
Sent: Thursday, April 13, 2006 9:28 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Ambiguous Nmae in Query Expression

On 13 Apr 2006 at 8:41, Kaup, Chester wrote:

> I have a function in a module as follows:
> 
> Function DaysInMonth2(D As Variant) As Variant

First point - avoid variants wherever possible. Try defining D and the 
function as dates.

> When I try to use the function in a query I get the message Ambiguous
> Name in Query Expression (DaysInMonth2([ProdPattern]![Date]) AS Expr1)
> 
> This is the first time I have tried to use a user defined function in
a
> query. I need some help on how to do this. Thanks
> 
> 
> 
> The SQL is a follows:
> 
> SELECT ProdPattern.PID, ProdPattern.Date, ProdPattern.vm_wtri,
> ProdPattern.vm_co2i, [qry Pattern Days on Injection by
> Fluid].vm_dyswtri, [qry Pattern Days on Injection by
Fluid].vm_dysco2i,
> DaysInMonth2([ProdPattern]![Date]) AS Expr1
> 
Try a dot instead of a bang in [ProdPattern]![Date]

-- 
Stuart


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list