K
Karen
I have a textbox that I am trying to assign a value to:
txtFullAddress.Value = FullAddress(txtAddress.Value, txtAddress2.Value, _
txtCity.Value, txtState.Value, txtZip.Value)
where FullAddress is a module
Public Function FullAddress(Address As String, _
Address2 As String, City As String, _
State As String, Zip As String) As String
FullAddress = IIf(IsNull(Address), "", Address) & _
IIf(IsNull(Address2), "", vbCrLf & Address2) & _
IIf(IsNull(City), "", vbCrLf & City) & _
IIf(IsNull(State), "", ", " & State) & _
IIf(IsNull(Zip), "", " " & Zip)
End Function
I have also tried to change the function to take the passing arguments as variants in case null was messing it up. No matter what I get a 'type mismatch' error on the line of code at the very top that assigns the value.
Any ideas?
txtFullAddress.Value = FullAddress(txtAddress.Value, txtAddress2.Value, _
txtCity.Value, txtState.Value, txtZip.Value)
where FullAddress is a module
Public Function FullAddress(Address As String, _
Address2 As String, City As String, _
State As String, Zip As String) As String
FullAddress = IIf(IsNull(Address), "", Address) & _
IIf(IsNull(Address2), "", vbCrLf & Address2) & _
IIf(IsNull(City), "", vbCrLf & City) & _
IIf(IsNull(State), "", ", " & State) & _
IIf(IsNull(Zip), "", " " & Zip)
End Function
I have also tried to change the function to take the passing arguments as variants in case null was messing it up. No matter what I get a 'type mismatch' error on the line of code at the very top that assigns the value.
Any ideas?