MS Access : multiple instances of form => can't use . recordset property

hi all,

I want the user to be able to view multiple instances of my 'customer form' in my MS Access Project.

I am able to do that : I have created a function that creates a new form and puts its reference in a collection (Coll_Customerforms).

I use the following code to set the bookmark of the new form to a selected value (txt_customernumber).
As you can see, I also change the caption.
Changing the caption works okay, but asking the recordset property is not (method not supported) :

Private Sub cmd_client_Click()
Dim nr, Windownumber As Integer

nr = Me.txt_customernumber
New_Customerform '= function to create and activate new instance of form
Window= Coll_Customerforms.Count
Coll_Customerforms.Item(Window).Caption = "Clientform " & Windownumber
Coll_Customerforms.Item(Window).Recordset.FindFirst "ID=" & nr

Why does this last line not work?
Who is Participating?
naivadConnect With a Mentor Commented:
Option Compare Database
Private myNewForm As Form_Form4
Private Sub Command2_Click()

    Set myNewForm = New Form_Form4
    With myNewForm
        .Caption = "test"
        .Filter = "ID=" & nr
        .FilterOn = True
        .Visible = True
    End With
End Sub
might have to bracket ID

"[ID]=" & nr
Thomas_VDBAuthor Commented:
Hi thanks for the comment,

but I found the mistake : I can't use the command "Findfirst" (=DAO), must use the command "Find" (=ADO).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.