Run-Time 13 Type mismatch

Marinus

I'm learning... :)
Local time
Today, 15:41
Joined
Jun 16, 2010
Messages
140
Hi All,

Probably very simple but I get above error when trying to run following code..
Could anyone shed some light please//

Code:
Private Sub cbPrintStock_Click()
 Dim strView As String
 Dim StrDocname As String
 Dim StrWhere As String
 

  strDelim = """"
   StrDocname = "rptStock"

    If Forms!frmTouchscreen.chkRepView = True Then
     strView = "acViewNormal"

Else

     strView = "acViewPreview"


End If
    
        DoCmd.OpenReport StrDocname, strView, , StrWhere, acWindowNormal
       
End Sub

The object is to send a report direct to the printer or show it on screen..
 
The View arguments are not strings. They are Integer constants which have those names.
 
The View arguments are not strings. They are Integer constants which have those names.

Thanks for the reminder.. Saved my day.. Like my old teacher used to say years ago, only use quotes when you really have too..
 

Users who are viewing this thread

Back
Top Bottom