Hi - newbie here, be gentle. In Access 2003, I've created a report (based on a query) to produce mailing labels for all records where [Contact Type] = "Community". [Contact Type] is a combo-box field with the values coming from a seperate table.
Problem is, some of these don't have addresses (ie. [Address 1], [Address 2] and [Post Code] are null). So I want to use the address of the Administrator for that community. This information is in records where [Contact Type] = "Administrator" and [Community] = whatever the community with the blank address is. [Community] is also a combo-box based on another table.
To do this, I wrote the following DLookUp for the first line of the address that I will place within an Nz() or If(IsNull()) expression when it's working:
=DLookUp("[Address 1]","[Main]","[Community] = " & Reports!Community!Community And "[Contact Type] = 'Administrator'")
However, this only gives the first line of the address of the first record in the table. When tested in the Immediate pane in VB I get "Type mismatch". If I test the same expression with only the first criteria I get "You canceled the previous operation", with only the second criteria I get "Data type mismatch". But if I test the criteria by themselves (seperately) they seem to work.
In summary, I seem to be getting the syntax for multiple text criteria of a DLookUp expression wrong .
Anyone got any ideas? I know the best thing would be a Recordset but I havent got a clue how to do them. Sorry for the long post, hope it makes sense, and thanks very much in advance!