Solved

GoTo record using listbox on subform

Posted on 2013-12-30
2
579 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
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

820 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