Solved

GoTo record using listbox on subform

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Auto-generated ID's in MS Access 9 46
Programmer 14 48
Access report groups with sums 5 26
VIDEO DATASOURCE Control Resize issue 2 17
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

776 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