Results 1 to 10 of 10
  1. #1
    ragpatil is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    11

    Data mismatch error in Access report

    Hi ,

    I am having a texbox in the report and I have set the control source to a Field from the query which is set as control source for the report.
    Now when there some null values in this field , I am getting the error Data mismatch .

    Please provide some suggestions how we can handle this.



    Thanks in advance.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Are these fields with nulls being used in relationships/linking the tables or in criteria/filters?
    You may want to address the NULL values and convert them to something using the NZ or ISNULL functions.

  3. #3
    ragpatil is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    11

    reply

    Quote Originally Posted by JoeM View Post
    Are these fields with nulls being used in relationships/linking the tables or in criteria/filters?
    You may want to address the NULL values and convert them to something using the NZ or ISNULL functions.
    Thanks for the reply .

    I am setting the value of text box in the Control Source as
    =(Space(3) & IIf([typeReturn]="T",[ipaydate1],""))

    So here if ipaydate1 is null , I am getting the error

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Try:
    =(Space(3) & IIf([typeReturn]="T",NZ([ipaydate1],""),""))


  5. #5
    ragpatil is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    11

    Re:

    Thanks a lot .

    After using Nz function also I am getting the same error .
    When I tried to put data in those field ipaydate1 in table , I am able to see the report.

    Kindly provide some suggestions.

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Can you post the SQL code of your query?

  7. #7
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Does the Field [typeReturn] have Null values and do you get the error on these records.

  8. #8
    ragpatil is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    11
    Hi,
    typereturn is also contains null values .

    I also tried by setting the control source with = Nz([ipaydate1],"").
    Then also I am getting the same error.

    And the ipaydate1 is a text field.

  9. #9
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    If TypeReturn has Null values then you need to give it a value. Try If(Nz(TypeReturn),0) etc

  10. #10
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    EDIT

    If TypeReturn has Null values then you need to give it a value. Try If(Nz(TypeReturn),0) etc


    IIf(Nz([typeReturn],0) = T,[ipaydate1]," ")

    Is this the correct spelling "ipaydate1"



    The above is untested.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Data type mismatch error
    By Tomfernandez1 in forum Programming
    Replies: 5
    Last Post: 10-05-2012, 07:27 AM
  2. Data type mismatch error
    By nigelbloomy in forum Programming
    Replies: 1
    Last Post: 08-01-2012, 09:19 AM
  3. Replies: 1
    Last Post: 05-11-2012, 10:59 AM
  4. Data type mismatch error
    By AccessUser123 in forum Queries
    Replies: 1
    Last Post: 05-22-2011, 07:48 PM
  5. Data Mismatch Error
    By sneupane in forum Access
    Replies: 5
    Last Post: 03-15-2010, 08:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums