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.
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.