L
Lungta
I'm using Albert Kallal's Word Merge sample and managed to change the
recordsource to a query instead of picking up the controls from the open form.
The merge will be run from a cmd button on the case form (frmCase1) and I
need to specify a WHERE statement so it prints only the records associated
with the current CaseID. The textbox to be referenced is txtCaseID, field is
CaseID. How would I add the "where CaseID=frmCase1!CaseID"? I keep getting
error msg no matter which combination of quotes, etc. I use - either argument
not optional or no created, make sure the sql is correct. Would somebody be
able to point me in the right direction?
Option Compare Database
Option Explicit
Dim strSQL As String
Dim qryNotifLettersxl As String
Private Sub cmdMergeAll_Click()
strSQL = "Select * from qryNotifLettersxl"
Me.Refresh
' MergeAllWord ("select * from " & Me.RecordSource)
MergeAllWord ("select * from qryNotifLettersxl")
'Note that you could use a condtion in the above sql
End Sub
Thanks!
recordsource to a query instead of picking up the controls from the open form.
The merge will be run from a cmd button on the case form (frmCase1) and I
need to specify a WHERE statement so it prints only the records associated
with the current CaseID. The textbox to be referenced is txtCaseID, field is
CaseID. How would I add the "where CaseID=frmCase1!CaseID"? I keep getting
error msg no matter which combination of quotes, etc. I use - either argument
not optional or no created, make sure the sql is correct. Would somebody be
able to point me in the right direction?
Option Compare Database
Option Explicit
Dim strSQL As String
Dim qryNotifLettersxl As String
Private Sub cmdMergeAll_Click()
strSQL = "Select * from qryNotifLettersxl"
Me.Refresh
' MergeAllWord ("select * from " & Me.RecordSource)
MergeAllWord ("select * from qryNotifLettersxl")
'Note that you could use a condtion in the above sql
End Sub
Thanks!