You don't print forms, you print reports.
Build a report and print it using your button. Reports have the controls
needed to set up proper printing. Forms don't.
As far as why your current process only works for some of them, I could not
tell you. Are you saving the record before pulling up the letter? Could
this be happening because you sometimes add a new patient and try to print
the letter before you have save it? Is your "letter" pulling patient
information from the table, or directly from the fields on your form?
Just FYI,
By default, when you open a report, it will produce the report for all the
records in your query or table. Here is the code yo ucan use to cause your
button to open a report and only show the current record. This code will
take care of saving the record before opening the report.
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
Notes: If your primary key is a Text type field (not a Number type field),
you need extra quotes: strWhere = "[ID] = """ & Me.[ID] & """"
If you want the report to print without preview, replace acViewPreview with
acViewNormal.