If you are building a query in VBA in a string it would look like this...
Code:
sqlSTR = "<NAME>" & [tABLE].Name & "</NAME>" & _
"IIF(IsNull([tABLE].Age, '', '<AGE>' & [tABLE].Age & '</AGE>') & _
"IIF(IsNull([tABLE].Gender, '', '<GENDER>' & [tABLE].Gender & '</GENDER>') ...
Or if you are building a query in SQL view it would look like this
Code:
"<NAME>" & [tABLE].Name & "</NAME>" & IIF(IsNull([tABLE].Age, """", "<AGE>" & [tABLE].Age & "</AGE>") & IIF(IsNull([tABLE].Gender, """", "<GENDER>" & [tABLE].Gender & "</GENDER>") ...
YOu'll have to figure out how many quotes go where...