Hi Bob
A very interesting looking query!!
I suspect the problem in in the function call:
NumbersOnly([Subject])
I assume that NumbersOnly is a user-defined function somewhere in one of
your project's modules.
My guess is that is it is declared to receive an "As String" argument. For
example:
Public Function NumbersOnly ( MyArgument As String ) As <something>
Because Null is not a string, this will fail. You must either convert the
Null to a string, or change the function so it will accept the Null. The
only VB data type that can be Null is a Variant, so you must change the "As
String" to "As Variant".
I'm sure that if you tell us what NumbersOnly is doing (i.e. post the code)
then someone might be able to suggest a simpler form for your query.
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
"bobdydd" <re**************@yahoo.co.uk> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi Graham
Thanks for taking the time to help me. The SQL of this query is a s
follows:
SELECT CDbl(Format([Received],"yymmddnnss")) AS InboxID, ([Created]) AS
CreatedDate, ([Created]) AS CreatedTime, Inbox.From, Inbox.To,
Inbox.Subject, Inbox.Contents, NumbersOnly([Subject]) AS
NumbersInSubjectField, Right([NumbersInSubjectField],10) AS
ListingEbayNumber, Day([received])+10 AS IDDay, Hour([received])+10 AS
IDTimeHour, Minute([received])+10 AS IDTimeMinute,
Second([received])+10 AS IDTimeSecond
FROM Inbox
WHERE (((NumbersOnly([Subject])) Is Not Null) AND ((Day([received])+10)
Is Not Null) AND ((Hour([received])+10) Is Not Null) AND
((Minute([received])+10) Is Not Null) AND ((Second([received])+10) Is
Not Null))
ORDER BY Inbox.Subject;