P
Piperlynne
Hello,
I am using this code to allow users to print the current record on the form.
It is working for two of my other forms, but not this one. it keeps popping
up a parameter value box.
Private Sub cmdPrtProdSetupbyCust_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 = "[Profitability_Code] = " & Me.[Profitability_Code]
DoCmd.OpenReport "rptProductSetupALL", acViewPreview, , strWhere
End If
End Sub
Profitability_Code is a number field. I have also tried it with the extra
quotes (i.e - strWhere = "[Profitability_Code] = """ &
Me.[Profitability_Code] & """")
Any clue as to why this is happening?
Any help appreciated. -
Thanks in advance.
I am using this code to allow users to print the current record on the form.
It is working for two of my other forms, but not this one. it keeps popping
up a parameter value box.
Private Sub cmdPrtProdSetupbyCust_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 = "[Profitability_Code] = " & Me.[Profitability_Code]
DoCmd.OpenReport "rptProductSetupALL", acViewPreview, , strWhere
End If
End Sub
Profitability_Code is a number field. I have also tried it with the extra
quotes (i.e - strWhere = "[Profitability_Code] = """ &
Me.[Profitability_Code] & """")
Any clue as to why this is happening?
Any help appreciated. -
Thanks in advance.