NULL VALUES IN DATE FIELD - TYPE MISMATCH ERROR 
Author Message
 NULL VALUES IN DATE FIELD - TYPE MISMATCH ERROR

I AM USING ACCESS 97.
I HAVE A TEXT FIELD NAMED 'OUTCOME' AND A DATE FIELD NAMED
LETTERSENTDATE.
ON A FORM, I AM GETTING A 'TYPE MISMATCH' ERROR WHEN THIS
CODE IS TRIGGERED:

IF ME.OUTCOME="P" AND ISNULL(ME.LETTERSENTDATE) THEN
 (CODE TO INSERT SOME TEXT INTO COMMENTS FIELD)
ENDIF

CAN ANYONE PLEASE HELP WITH THIS



Tue, 16 Aug 2005 00:57:08 GMT  
 NULL VALUES IN DATE FIELD - TYPE MISMATCH ERROR


Quote:
> I have a text field named 'Outcome' and a date field named
> LetterSentDate.

> On a form, I am getting a 'type mismatch' error when this
> code is triggered:

> If Me.Outcome="p" And IsNull(Me.LetterSentDate) Then
>  ' (code to insert some text into comments field)
> Endif

This is probably nothing to do with the IsNull function, but more to do
with the dot operators. Try replacing them with !bang operators, because
you are looking for members of a collection, not properties of the Me
object. If you are still getting referencing problems, then the full syntax
is this:

  If (Me.Controls("Outcome") = "p") And _
     (IsNull(Me.Controls("LetterSentDate"))) Then
  ...

Hope that helps

Tim F



Tue, 16 Aug 2005 04:05:51 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Insert #NULL# into Date field causes datatype mismatch error

2. null value in a field data type as date

3. Null date values in Date/Time fields in Access DB

4. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

5. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

6. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

7. Populating Null value in SQL Date/Time field

8. type mismatch error; date sort

9. How to give Date fields null values?

10. Allowing a date field to be null value

11. Re.allowing a date field to take null value

12. date field and null values

 

 
Powered by phpBB® Forum Software