Good morning,
In my code I'm looking for whether or not a string exists using the Dlookup function. I've declared the variable as a string but it seems like an error will occur in this instance if there is nothing found because of the null to zero. Should I change the code, leave it or is there something else I am not seeing. I could use a second set of eyes if someone would like to jump in.
Dim doesMeter4Exist as String
doesMeter4Exist = Nz(DLookup("unitOfMeasure", "TblrunningMeter", "meterID = 4 AND unitID = forms!frm_mainUnit!unitID"))
If Not doesMeter4Exist = "" Then ....blah blah blah
Thank you
In my code I'm looking for whether or not a string exists using the Dlookup function. I've declared the variable as a string but it seems like an error will occur in this instance if there is nothing found because of the null to zero. Should I change the code, leave it or is there something else I am not seeing. I could use a second set of eyes if someone would like to jump in.
Dim doesMeter4Exist as String
doesMeter4Exist = Nz(DLookup("unitOfMeasure", "TblrunningMeter", "meterID = 4 AND unitID = forms!frm_mainUnit!unitID"))
If Not doesMeter4Exist = "" Then ....blah blah blah
Thank you