bobleonard
Programmer
I got the following code off a tek-tip post:
When I run it, all the fields come up '#Name?'
I assume the query is bad, But it is: ID = 1
for first record. Any suggestions?
Private Sub Command226_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 = " & Str([ID])
MsgBox (strWhere)
DoCmd.OpenReport "rpt_Sp", acViewPreview, , "ID = " & Str([ID])
End If
Thanks,
BLeonrd
When I run it, all the fields come up '#Name?'
I assume the query is bad, But it is: ID = 1
for first record. Any suggestions?
Private Sub Command226_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 = " & Str([ID])
MsgBox (strWhere)
DoCmd.OpenReport "rpt_Sp", acViewPreview, , "ID = " & Str([ID])
End If
Thanks,
BLeonrd