Results 1 to 2 of 2

Thread: type mismatch

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Location
    Mexico
    Posts
    16

    Question

    I'm doing a search using the next statment:

    Set RS = DB.OpenRecordset("SELECT id, Codigo, Venta, Compra FROM DT1 WHERE id =" & idnum, dbOpenDynaset)

    to prevent geting an error if one of the fields is blanck I´m doing the next for a string variable

    scod = "" & RS!Codigo

    but the next variable store a integer value, and when it gets to field with an negative value, I´m geting a Run Time error 13, Type mismatch.

    icompra = 0 & RS!Compra

    any sugestions.

    Thanks

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    try:

    if IsNull(RS!Compra) then
    icompra = 0
    else
    icompra = RS!Compra
    end if

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width