Results 1 to 6 of 6
  1. #1
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124

    Run-time error '2465': MS Access can't find the field '|' referred to in your express

    Please help me fix the error below

    Run-time error '2465': MS Access can't find the field '|' referred to in your expression.

    My code:

    Private Sub ShowRecord_Click()
    'Find a selected record, then close the search dialog box
    DoCmd.OpenForm "ContactDetail"
    [tblContacts.ID] = Me.lstItems.Column(0)



    'Close the dialog box
    'DoCmd.Close acForm, "Menu"

    End Sub

    Thanks

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Try this:
    Code:
    Private Sub ShowRecord_Click()
    'Find a selected record, then close the search dialog box
    DoCmd.OpenForm "ContactDetail", , "[tblContacts.ID] = " & Me.lstItems.Column(0)
    
    'Close the dialog box
    'DoCmd.Close acForm, "Menu"
    
    End Sub
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    The same

    I have a new problem: Run-tome error '2450'

    Searching Using a ListBox can't find the form 'Menu' referred to in a macro expression or Visual Bacsic code

    Below is my code

    Private Sub Form_Open(Cancel As Integer)

    'Me.ID.Value = Forms!Menu!lstItems.Column(0)
    'txtid.Caption = lstItems.Column(0)
    Me.Title.Value = Forms!Menu!lstItems.Column(1)
    Me.Full_Name.Value = Forms!Menu!lstItems.Column(2)
    Me.Mobile.Value = Forms!Menu!lstItems.Column(3)
    Me.Email_Company.Value = Forms!Menu!lstItems.Column(4)
    Me.Email_Personal.Value = Forms!Menu!lstItems.Column(5)
    Me.Company_Name.Value = Forms!Menu!lstItems.Column(6)
    Me.Home_Address.Value = Forms!Menu!lstItems.Column(7)
    Me.Company_Address.Value = Forms!Menu!lstItems.Column(8)
    Me.Position.Value = Forms!Menu!lstItems.Column(9)
    Me.Data_Source.Value = Forms!Menu!lstItems.Column(10)
    Me.Remarks.Value = Forms!Menu!lstItems.Column(11)
    Me.Telephone.Value = Forms!Menu!lstItems.Column(12)
    Me.Fax.Value = Forms!Menu!lstItems.Column(13)
    Me.Country.Value = Forms!Menu!lstItems.Column(14)
    Me.Birthday.Value = Forms!Menu!lstItems.Column(15)
    Me.Category.Value = Forms!Menu!lstItems.Column(16)
    Me.Web_Page.Value = Forms!Menu!lstItems.Column(17)

    End Sub

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    You are getting this error because you have closed the form called Menu
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    uronmapu is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    124
    I don't understand, could you explain

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    The error msg you get made me think that the form may have been closed and when I noticed the line of code in your post #1 that would close the form I jumped to the conclution that the form had been closed.
    If the code that is giving the error is in the Open event of the ContactDetail form, try moving it to the Load event.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Replies: 5
    Last Post: 05-04-2019, 09:02 PM
  2. Replies: 9
    Last Post: 06-08-2012, 07:52 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