I hope someone can help please.
I have a command button on my form and when you click it (on the record for, say, "Wally Chambers") it prints off a report with the required data from Wally Chambers' record. The code is:
Private Sub Command233_Click()
On Error GoTo Err_Command233_Click
Dim strDocName As String
Dim strFilter As String
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
strDocName = "Directions Letter WC"
strFilter = "[Telephone] = Forms!Reservations![Telephone]"
DoCmd.OpenReport "Directions Letter WC", acViewNormal, , strFilter
Exit_Command233_Click:
Exit Sub
Err_Command233_Click:
MsgBox Err.Description
Resume Exit_Command233_Click
End Sub
I'm fine with this and it does what I want.
However, the problem is that I created this code so long ago I can't remember why or how it works; I seem to remember that I created a link (or filter ? maybe) between the fields "Telephone" (this field is unique ro each record) so that the data used to populate the report is just from Wallys' record.
I've googled Mail Merge but this hasn't helped at all.
I have a new task and now need the button to open a word mail merge document (populated with Wallys' details) but I'm not sure what I need to do to change the code.
The path for the word document is "H:\CorrespondenceLetters\MailMerge\BrksDednsEm.do c"
I definately want to point to a mail merge word document and not a access report for this new task.
Can anyone help please ?