Solved

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

Posted on 2004-08-19
3
239 Views
Last Modified: 2008-03-03
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?
0
Comment
Question by:Thomas_VDB
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
naivad earned 40 total points
ID: 11846976
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
0
 
LVL 4

Expert Comment

by:naivad
ID: 11846978
might have to bracket ID


"[ID]=" & nr
0
 

Author Comment

by:Thomas_VDB
ID: 11852098
Hi thanks for the comment,

but I found the mistake : I can't use the command "Findfirst" (=DAO), must use the command "Find" (=ADO).
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now