Address1: Iif(Instr([Address], vbCrLf)=0, [Address], Left([Address],Instr([Address], vbCrLf)-1))
Address2: Iif(Instr([Address], vbCrLf)=0, Null, Mid([Address],Instr([Address], vbCrLf)+1))
The MID function normally takes two arguments:
Mid(String, Start, Number of letters)
But if you leave out number of letters it assumes the rest of the length of the string. The long way to write it would be
Address2: Iif(Instr([Address], vbCrLf)=0, Null, Mid([Address],Instr([Address], vbCrLf)+1), Len([Address])-Instr([Address], vbCrLf)+1))
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|