Subform/Main Form Reference

B

Brian

I'm creating a database so that we can have a unified spelling directory for
"people in the news", both politicians and celebrites. I've got it set up so
that people can type in all or part of the name and get a list of results.
Then I want them to be able to double click on the entry and bring them to
the main form with all of that individuals information.

My boss wants it so that they will get both the correct and incorrect
spellings in the selection list. The problem that I'm having is that I can
get it so that if someone double clicks on the correct spelling it goes to
the correct record,while the incorrect name goes to the first record in the
form. The incorrect name spellings are on the main form as a subform.

If someone could look at the code and let me know what I'm doing wrong it
would be much apriciated.

Thanks.

Dim R As Recordset
Dim RI As Recordset
Dim frm As Form

Set R = Forms![frmlistinglookup].RecordsetClone 'correct listing main form
Set frm = Forms![frmlistinglookup]![sbFrmIncorrectListing].Form ' incorrect
listing subform
Set RI = frm.RecordsetClone

R.FindFirst "Correct_listing Like" & Chr(34) & Me![lstNames] & "*" & Chr(34)

If NoMatch Then

RI.FindFirst "[InCorrect_listing] Like" & Chr(34) & Me![lstNames] & "*" &
Chr(34)
frm.Bookmark = RI.Bookmark

Else

Forms![frmlistinglookup].Bookmark = R.Bookmark
End If
 
Top