I'm using the following code in a command button.
Dim strDocName As String
Dim strWhere As String
If ([Mid] = "111") Then strDocName = "Report1"
If ([Mid] = "222") Then strDocName = "Report2"
If ([Mid] = "222") Then strDocName = "Report1"
strWhere = "[Mrecordid]=" & Me!Mrecordid
DoCmd.OpenReport strDocName, acViewReport, , strWhere
I'm getting the following error: The action or method requires a report name argument.
What am I doing wrong?
Thanks...
Dim strDocName As String
Dim strWhere As String
If ([Mid] = "111") Then strDocName = "Report1"
If ([Mid] = "222") Then strDocName = "Report2"
If ([Mid] = "222") Then strDocName = "Report1"
strWhere = "[Mrecordid]=" & Me!Mrecordid
DoCmd.OpenReport strDocName, acViewReport, , strWhere
I'm getting the following error: The action or method requires a report name argument.
What am I doing wrong?
Thanks...