I have a form showing a textbox with different names of persons - 2-clicking on one of the names shold:
1) CLOSE THE CURRENT FORM
2) Open another form showing that person from the 2-click
I use this code in the 2-click event of the textbox
Dim f As Form, rst As DAO.Recordset
DoCmd.Close acForm, Me.Name
If CurrentProject.AllForms("PERSON Vedligehold af").IsLoaded Then
Set f = Forms("PERSON Vedligehold af")
Set rst = f.Recordset.Clone
rst.FindFirst "[PersonID] = " & Me.PersonID
f.Bookmark = rst.Bookmark
Set f = Nothing
Set rst = Nothing
Else
DoCmd.OpenForm "PERSON Vedligehold af", , , "PersonID = " & PersonID
End If
And it works nicely EXCEPT the first form is still open !
What do I do wrong ?