Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

GoTo record using listbox on subform

Posted on 2013-12-30
2
Medium Priority
?
589 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 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