I have read much code about mailmerging but I came across a simple bit of code in one of MS sample files which opens a wizard asking user whether he wishes to merge to new doc or existing etc and it works beautifully.
However I have two seemingly easy obstacles.
1. when I open from the mde version of the same file it opens word and when it tries to link to the db it says that its currently locked by another user etc.??
2. In desigm mnode everything was fine but in run mode , all of a sudden the main db window (the one showing all tables queries reoprts etc) opened up, something I would never want a user to see , never mind have access to!
Here is my code:
Private Sub cmdMerge_Click()
Dim strQry As String
If Me.lstReports.Value = 14 Then
strQry = "qryparentslabels"
ElseIf Me.lstReports.Value = 15 Then
strQry = "quickprint"
End If
DoCmd.SelectObject acQuery, strQry, True
DoCmd.RunCommand acCmdWordMailMerge
End Sub
Thanks
However I have two seemingly easy obstacles.
1. when I open from the mde version of the same file it opens word and when it tries to link to the db it says that its currently locked by another user etc.??
2. In desigm mnode everything was fine but in run mode , all of a sudden the main db window (the one showing all tables queries reoprts etc) opened up, something I would never want a user to see , never mind have access to!
Here is my code:
Private Sub cmdMerge_Click()
Dim strQry As String
If Me.lstReports.Value = 14 Then
strQry = "qryparentslabels"
ElseIf Me.lstReports.Value = 15 Then
strQry = "quickprint"
End If
DoCmd.SelectObject acQuery, strQry, True
DoCmd.RunCommand acCmdWordMailMerge
End Sub
Thanks