I am new to using vb classes and need some help with syntax (I think).
I have a report and reports class in a dll called RptClassLib that I populate in the Main section of my project.
Dim grpts As RptClassLib.GEMSReports
Dim grpt As RptClassLib.GEMSReport
Dim rs As Recordset
Set grpts = New GEMSReports
Set grpt = New GEMSReport
Set rs = deGEMS.rsReport
rs.Open
Do While Not (rs.EOF)
grpt.GReportDescription = rs.Fields("RptDescription"
.Value
grpt.GReportName = rs.Fields("RptName"
.Value
grpts.Add grpt.Key, grpt.GReportName, grpt.GReportDescription, grpt.GReportCategory
rs.MoveNext
Loop
rs.Close
This appears to work fine. My problem is: I thought once I instantiated the classes I could use them throughout my project without having to re-instantiate them.
I have added a form to my project and want to use the class properties to populate some list boxes. I assume that I would populate the form controls in the form_load event. What is the syntax for doing this?
Any help or information source is appreciated.
Rene'
I have a report and reports class in a dll called RptClassLib that I populate in the Main section of my project.
Dim grpts As RptClassLib.GEMSReports
Dim grpt As RptClassLib.GEMSReport
Dim rs As Recordset
Set grpts = New GEMSReports
Set grpt = New GEMSReport
Set rs = deGEMS.rsReport
rs.Open
Do While Not (rs.EOF)
grpt.GReportDescription = rs.Fields("RptDescription"
grpt.GReportName = rs.Fields("RptName"
grpts.Add grpt.Key, grpt.GReportName, grpt.GReportDescription, grpt.GReportCategory
rs.MoveNext
Loop
rs.Close
This appears to work fine. My problem is: I thought once I instantiated the classes I could use them throughout my project without having to re-instantiate them.
I have added a form to my project and want to use the class properties to populate some list boxes. I assume that I would populate the form controls in the form_load event. What is the syntax for doing this?
Any help or information source is appreciated.
Rene'