Solved

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

Posted on 2004-08-19
3
241 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL, Updating Statistics take too long for 60GB database 5 132
syadmin MSSQL 2 66
AWS RDS Backups? 3 41
What's wrong with this T-SQL Foreign Key? 7 46
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
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…

777 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