Here's something I use with downloaded JSON address data for UK postcodes from a provider called Ideal Postcodes
The field names are slightly different but the principle is the same
Code:
AddressLine = IIf(OrganisationName <> "", OrganisationName & ", ", "") & _
IIf(SubBuildingname <> "", SubBuildingname & ", ", "") & _
IIf(Buildingname <> "", Buildingname & ", ", IIf(BuildingNumber <> "", BuildingNumber & " ", "")) & _
Thoroughfare & ", " & IIf(DependantLocality <> "", DependantLocality & ", ", "") & _
PostTown & ", " & County & ", " & Country & ", " & POSTCODE
If Left(AddressLine, 1) = "," Then AddressLine = Mid(AddressLine, 3)
AddressBlock = Replace(AddressLine, ", ", vbCrLf)
As you can see, I create both an address line and an address block.
You can skip the AddressLine if you wish
I don't use a comma at the end of each line in an address block
IIf statements are used for fields which may or may not exist in a particular address e.g. BuildingName
Other fields such as PostTown & Postcode ALWAYS exist so these don't need IIf statements.