U
UpRider
I need to feed a subroutine a query name from a form. The subroutine prints
labels a line at a time to a dot matrix printer (no reportdef involved),
using parameters that identify the query and the number of labels to print.
How can I turn the form's recordsetclone (selecting the current record) into
a query? Currently I use the same query as the form recordsource and it
works fine, but I'd like to make it generic for any form and recordsource,
thus the recordsetclone idea.
Any attempts to diminish my ignorance are welcome and appreciated.
UpRider
'"""""Begin fragment, code is in form module
If MsgBox("Use Epson-500 dot matrix printer in label save mode?",
vbYesNo) = vbYes Then
DoCmd.SetWarnings False
'DoCmd.DeleteObject acQuery, "qtempQuery"
DoCmd.SetWarnings True
'below is recordsource of form and select criteria (Lastid is PK of
underlying table)
strSQL = "select * from qDBTCMmastAlpha where LastID =" & Chr$(39) &
Me.txtLASTID & Chr$(39)
Set qthisQuery = db.CreateQueryDef("qtempQuery", strSQL)
Call subPrintDotMatrixLabels("qtempQuery", NumLab)
Exit Function
End If
"""""End fragment
labels a line at a time to a dot matrix printer (no reportdef involved),
using parameters that identify the query and the number of labels to print.
How can I turn the form's recordsetclone (selecting the current record) into
a query? Currently I use the same query as the form recordsource and it
works fine, but I'd like to make it generic for any form and recordsource,
thus the recordsetclone idea.
Any attempts to diminish my ignorance are welcome and appreciated.
UpRider
'"""""Begin fragment, code is in form module
If MsgBox("Use Epson-500 dot matrix printer in label save mode?",
vbYesNo) = vbYes Then
DoCmd.SetWarnings False
'DoCmd.DeleteObject acQuery, "qtempQuery"
DoCmd.SetWarnings True
'below is recordsource of form and select criteria (Lastid is PK of
underlying table)
strSQL = "select * from qDBTCMmastAlpha where LastID =" & Chr$(39) &
Me.txtLASTID & Chr$(39)
Set qthisQuery = db.CreateQueryDef("qtempQuery", strSQL)
Call subPrintDotMatrixLabels("qtempQuery", NumLab)
Exit Function
End If
"""""End fragment