Solved

GoTo record using listbox on subform

Posted on 2013-12-30
2
583 Views
Last Modified: 2013-12-30
I have a form that has a main form and then a subform.  The subform is linked to a different table than the main form.  I am trying to go to the record clicked on the subform.  So example
I click an item in the listbox from the subform and the subform goes to that item number.  I have tried:

'find the first value that matches
Me.[frmsubworkorder].[Form].RecordsetClone.FindFirst _
"[item] = " & [frmsubworkorder].[Form]![List4]

'if a matching record was found, then move to it
If Not [frmsubworkorder].[Form].RecordsetClone.NoMatch Then
[frmsubworkorder].[Form].formBookmark _
= [frmsubworkorder].[Form].Form.RecordsetClone.Bookmark
End If

When I try this I get the following runtime error:
Run-time error '2465':
Microsoft Office Access can't find the fild '|' referred to in you expression.

I have checked and list4 is showing the correct item number.

Any help would be greatly appreciated!!  Thanks in advance!
0
Comment
Question by:russell12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39747332
try this using the afterupdate event of [List4], or using a click event of a button in the subform


private sub list4_afterupdate()

with me.recordsetclone
       .FindFirst  "[item] = " & me.List4
      if not .nomatch then
       me.bookmark=.bookmark
       else
        msgbox "Record not found"
        exit sub
      end if
end with

end sub



Note: if [item] field is Text data type use
       .FindFirst  "[item] = '" & me.List4 & "'"
0
 
LVL 2

Author Closing Comment

by:russell12
ID: 39747338
ARE YOU SERIOUS!!! I have been working on this issue for about 1 month and I was going to try experts exchange for one last resort before just making another form to view the record from the subform.  You are a life saver!!!!  Thank you!!!!!
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question