Go to a record in a form from another form.

apishapa

New member
Local time
Today, 14:04
Joined
Feb 9, 2012
Messages
3
I know I've seen this here, but I cannot get it to work. I am using Access 07.
I need to use a lookup form to find a record on a data entry form. I have a bunch of Accounts with the same name, so I use AKA Names to search for the one I am looking for. Since the reports come in under the Generic Name, I can't just search by the real name. Like I have 6 plans that are reported by on eentity called "LaFarge". The real name of the PLan might be something like "120TH ESTATES PARTNERS AUG". There is a separate accounting records for each of those entities.
I have a form with the Plan_Names and the AKA_Plan_Names and a couple of other fields as identifiers. The underlying query for teh AKA form sorts the Plans that Use this AKA_Name. The code I am trying to use is:


Private Sub PLAN_NAME_DblClick(Cancel As Integer)
On Error GoTo Err_PlanName_DblCLick
Forms("f1_EditAcctg").Form.RecordsetClone.FindFirst "PLAN_NAME='" & Me.PLAN_NAME & "'"
Forms("f1_EditAcctg").Form.Bookmark = Forms("f1_EditAcctg").Form.RecordsetClone.Bookmark
Err_PlanName_DblCLick:
MsgBox Err.Number & Err.Description

End Sub

It opens the "f1_EditAcctg" form, but it doesn't go to the record. The error message just says "0". I've done this before with other applications, but I cannot get it to work for this one.
I copied the code from one of my other applications where it works fine.
 
By the way, the link uses a numeric value, so you'll need to add the quotes appropriate for a text value as you did above.
 

Users who are viewing this thread

Back
Top Bottom