Results 1 to 2 of 2
  1. #1
    dmon2010 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2013
    Posts
    39

    Form Button Not working Error 2465

    Hi. I'm using Access 2007. Have a project with several forms and reports, all work fine except the latest one I'm working on.

    I'm using the following code on many buttons in different forms to print specific reports:


    Dim strWhere As String


    If Me.Dirty Then 'Save any edits.
    Me.Dirty = False
    End If


    If Me.NewRecord Then 'Check there is a record to print
    MsgBox "Select a record to print"
    Else
    strWhere = "[ID] = " & Me.[ID]
    DoCmd.OpenReport "Label Ruta Unit", acViewPreview, , strWhere
    End If
    End Sub

    And they all work fine except for the last form I'm working on. This one gives me "Error 2465, Unable to find the field "|" referred to in your expression."

    When I debug, it highlights this part of the code:



    strWhere = "[ID] = " & Me.[ID]


    Also should mention I'm pretty much self taught and a beginner when it comes to Access. So please be gentle. lol.

    Any help is greatly appreciated.

  2. #2
    dmon2010 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2013
    Posts
    39
    Nevermind! Figured it out. Forgot to include it in the record source! Thanks anyway!!!!!!!!!!!!!!!!!

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

Similar Threads

  1. runtime error 2465 'l1'
    By mike02 in forum Forms
    Replies: 5
    Last Post: 07-17-2013, 03:37 PM
  2. run time error 2465
    By karma in forum Access
    Replies: 3
    Last Post: 08-09-2012, 04:08 AM
  3. Run Time Error 2465
    By jo8701 in forum Programming
    Replies: 1
    Last Post: 02-08-2012, 12:01 PM
  4. Run Time Error 2465 In Report
    By desk4tbc in forum Programming
    Replies: 9
    Last Post: 09-06-2011, 08:00 PM
  5. Run-Time error '2465'
    By hawkins in forum Access
    Replies: 6
    Last Post: 08-19-2011, 04:07 PM

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