0
0 1
In the following code, how can I return 0 if EncTypeID is Null?
For example, when VehTypeID is Null, I'd like sSubForm = 0 rather than = rst("VehicleFrm").
I tried using the Nz function put couldn't figure it out.
CODE:
Set dbs = CurrentDb()
strSql = "SELECT VehicleFrm FROM tblVehicleTypes Where VehTypeID=" & VehTypeIDF.Value
Set rst = dbs.OpenRecordset(strSql)
sSubForm = rst("VehicleFrm")
Thank you.
For example, when VehTypeID is Null, I'd like sSubForm = 0 rather than = rst("VehicleFrm").
I tried using the Nz function put couldn't figure it out.
CODE:
Set dbs = CurrentDb()
strSql = "SELECT VehicleFrm FROM tblVehicleTypes Where VehTypeID=" & VehTypeIDF.Value
Set rst = dbs.OpenRecordset(strSql)
sSubForm = rst("VehicleFrm")
Thank you.