Error when opening report

thmsjlmnt3953

Registered User.
Local time
Today, 15:02
Joined
May 20, 2014
Messages
120
Hi,

When i run the following code to open my report a receive the following error..

error 3070 the microsoft access database engine does not recognise " as a valid field name or expression
Code:
    strDocName = "rptBarcodingMonthly"
    MsgBox strDocName
    DoCmd.OpenReport strDocName, acViewPreview
The code behind the report - sets on open_report event is the following however i cant see any issues with it as i use it elsewhere..
Code:
    '  Create underlying recordset for report using criteria entered in
    
    
    Dim intX As Integer
    Dim qdf As QueryDef
    Dim frm As Form
            
    '  Set database variable to current database.
    Set dbsReport = CurrentDb
    Set frm = Forms!frmnavigation!NavigationSubform.Form
    
        
    '  Open QueryDef object.
   '   Set qdf = dbsReport.QueryDefs("EmployeeSales")
    
      Set qdf = dbsReport.QueryDefs(Me.RecordSource)
    
    
    ' Set parameters for query based on values entered
    ' in EmployeeSalesDialogBox form.
    qdf.Parameters("Forms!frmnavigation!NavigationSubform!BeginningDate") _
        = frm!beginningdate
    qdf.Parameters("Forms!frmnavigation!NavigationSubform!EndingDate") _
        = frm!endingdate

    '  Open Recordset object.
    Set rstReport = qdf.OpenRecordset()
    
    '  Set a variable to hold number of columns in crosstab query.
    intColumnCount = rstReport.Fields.Count
I will also attach a copy of how i set the criteria in the query and the parameters

any help would be fantastic:)

query.jpg
 

Users who are viewing this thread

Back
Top Bottom