Results 1 to 4 of 4
  1. #1
    Robert2150 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Location
    Sparks, Nv
    Posts
    102

    Error code when attempting to View Report

    I have a database that has been running well for over a year.
    I am now getting the following error when clicking button to View Report; Microsoft Visual Basic, Run-time error '3464', Data type mismatch in criteria expression. The following is the code for viewing report when button is clicked.

    Private Sub VIEW_SQ_FT_LN_FT_EA_ITEMS_REPORT_Click()
    Me.Visible = False
    strWhere = "[Property Number] = " & Me.[Property Number]
    DoCmd.OpenReport "SQ FT/LN FT ITEMS REPORT REV ADMIN", acViewPreview, , strWhere
    DoCmd.ShowToolbar "Ribbon", acToolbarNo



    End Sub

    Any suggestions? Thank you for your help in advance.

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Does the report open without error if you remove the strWhere filter.
    If so, then the issue would have to be that the datatype for Property Number field has been changed e.g. to text

    I can't quite believe that you have a report with that name. It's too long, contains spaces and a forward slash. Why?
    Similarly for your procedure name. Slightly better due to underscores but overcomplex
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    If so, then the issue would have to be that the datatype for Property Number field has been changed
    What about if the referenced control is Null?
    Agree about the name. Sometimes too much explanatory info ends up in names when the object properties could contain notes instead. Maybe rptSqLnFtPerItem...
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Hi micron

    If the referenced control is null, a different error will occur. Probably syntax error 3075 but easily solved with use of Nz or error handling
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 01-06-2018, 12:02 PM
  2. Replies: 10
    Last Post: 02-02-2017, 05:09 AM
  3. View VBA Code for a Report in Access 2010
    By deluxes in forum Reports
    Replies: 2
    Last Post: 12-15-2016, 03:44 PM
  4. Replies: 1
    Last Post: 09-22-2016, 05:05 AM
  5. Error Attempting to Export Data to IE9
    By Angrybox in forum Programming
    Replies: 9
    Last Post: 06-29-2012, 03:50 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums