myTable has a field called cPostal with these records :
2560-999
2399-142
2870-182
2999-600
I do have a dlookup that finds a match, but in case there is no match I would like to find a partial match for the first 4 characters, so let ´s say I am looking for the string
2870-000
since there is no match, I ' d like find the third record wich has the partial match for the first 4 characters (2870-182)
Is this posible or should I try a DAO.recordset ?
2560-999
2399-142
2870-182
2999-600
I do have a dlookup that finds a match, but in case there is no match I would like to find a partial match for the first 4 characters, so let ´s say I am looking for the string
2870-000
since there is no match, I ' d like find the third record wich has the partial match for the first 4 characters (2870-182)
Code:
fString="2870"
distritoID = DLookup("[distritoID]", "myTable", "left([cPostal],4) = """ & fString & """")
Is this posible or should I try a DAO.recordset ?