Me.TheTextBox = Me.OpenArgs
Private Sub cmdOpenReport_Click()
Dim strOpenArgs As String
strOpenArgs = "Open Args Value"
DoCmd.OpenReport "rptTestOpenArgs", acViewPreview, , , , strOpenArgs
End Sub
perfect, I was lazyThe simple way to display openargs is with a text box with a control source of:
=[OpenArgs]
Code:Private Sub cmdOpenReport_Click() Dim strOpenArgs As String strOpenArgs = "Open Args Value" DoCmd.OpenReport "rptTestOpenArgs", acViewPreview, , , , strOpenArgs End Sub
View attachment 118137
I had left the original code that I had used in my trial an error before I posted and when I changed it, I didn't pay attention.Your code doesn’t match mine. I didn’t have an “=“ or "strOpenArgs" (in quotes) in my OpenReport code.
How do you set the values for this table. It would help me by choosing number when the open report is clicked and set textbox in report to the company name.The simple way to display openargs is with a text box with a control source of:
=[OpenArgs]
Code:Private Sub cmdOpenReport_Click() Dim strOpenArgs As String strOpenArgs = "Open Args Value" DoCmd.OpenReport "rptTestOpenArgs", acViewPreview, , , , strOpenArgs End Sub
View attachment 118137
Private Sub cmdOpenReport_Click()
Dim strOpenArgs As String
Dim strWhere As String
strOpenArgs = Me.cboOpenArgsValue.Column(1)
strWhere = "CompanyID< " & Me.txtWhere
DoCmd.OpenReport "rptTestOpenArgs", acViewPreview, , strWhere, , strOpenArgs
End Sub