PDA

Click to See Complete Forum and Search --> : type mismatch


jrgmrz
Oct 9th, 2000, 01:51 PM
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

JHausmann
Oct 9th, 2000, 04:32 PM
try:

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