duplicate code

  • Thread starter Thread starter fathi_abuayyash via AccessMonster.com
  • Start date Start date
F

fathi_abuayyash via AccessMonster.com

i have this code

If IsNull(DLookup("Total_trns_volume", "Q_trnsf_in")) = False Then
sslt_trnsfin = DLookup("Total_trns_volume", "Q_trnsf_in")
slt_trnsfin = sslt_trnsfin
Else
slt_trnsfin = 0
End If

in case the query result were null then the code will give error, so i did
the above code to stop this error, but what i face is time consuming by
running the query twice , first for check then to obtain the result. any help
to eliminate this ?
Thanks
 
slt_trnsfin = Nz(DLookup("Total_trns_volume", "Q_trnsf_in"),0)

If slt_trnsfin <> 0 then
sslt_trnsfin = slt_trnsfin
End If
 
Back
Top