matrixindicator
IS-IT--Management
I convert a short description of a street to a long with a function eg. CL -> CALLE
However if there is not a short description he writes #Error, how just to place a emmpty string "" if there is no short description for the street ?
What do I need to adapt to my code ?
However if there is not a short description he writes #Error, how just to place a emmpty string "" if there is no short description for the street ?
What do I need to adapt to my code ?
Code:
Public Function TIPODESC(TipoKort As String) As String
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT STREETDESC FROM TblStreet WHERE StreetCode =""" & TipoKort & """", dbOpenDynaset)
If IsEmpty(TipoKort) Then
TIPODESC = ""
Else
TIPODESC = rst!STREETDESC
End If
End Function