duplicate code

  • Thread starter fathi_abuayyash via AccessMonster.com
  • 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
 
G

George Nicholson

slt_trnsfin = Nz(DLookup("Total_trns_volume", "Q_trnsf_in"),0)

If slt_trnsfin <> 0 then
sslt_trnsfin = slt_trnsfin
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top