Access 2000 view Outlook 2000 Inbox error

B

bobdydd

Hi Everybody

I have an Access 2000 query that "sees" the Outlook 2000 Inbox. This
works fine until an email arrives where the subject field is empty
(Null)

This causes a type mismatch message.

I have tried "Is Not Null" No Joy.

Does anyone know a way to trap this error?

Regards and Thanks Bob
 
G

Graham Mandeno

Hi Bob

hard to say without some more information.

How about you post the SQL of your query (View>SQL view, then copy and
paste).
 
B

bobdydd

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;
 
G

Graham Mandeno

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top