How to create a MS Word mail merge using an MS Access query with a criteria of Username
I have an MS Word document that I would like to populate with username details, namely; FirstName, LastName, PhoneNo, MobileNo & EmailAddress. I have an MS Access database that has a table called tblUsers with these fields plus a UserName field (FirstName.LastName). I have another table called tblProjects with project information. I have created an MS Access query that combines these 2 tables and has NetUser() as a criteria for the UserName field. NetUser code as follows;
Function NetUser()
Dim objNet
Dim strUser As String
Dim strDomain As String
Set objNet = CreateObject("WScript.Network")
strUser = objNet.UserName
Set objNet = Nothing
NetUser = strUser
End Function
The query lists all projects with same username details against each one. I then try and create a mail merge between word document and this query however the query does not appear in the list of available queries in mail merge wizard window. I understand that parameter queries cannot be used in a mail merge but why can't this query? How can I get around this or is there another method to achieve same result? Thanks in advance. Matt