gxpark
Aug 14th, 2000, 06:04 PM
I'm writing several class modules to access a database.
My question is, How can I bind a module instance (element of a collection) to a certain record in an open db?
Suppose I have a collection class called Employees, that holds Employee classes. Now, if I modify a property in the class Employee, or if I add a new entry using the Add method of the collection Employees, how do I update/add the record in the database?
I'm currently using the following approach:
' Example snippet from the Employee class
Public Property Let RFC(NewValue As String)
msRFC = NewValue
grsEmployees.Find msRFC
grsEmployees.Fields("RFC") = msRFC
End Property
Notes:
- msRFC is privately declared as a "String" in the Employee class/module
- grsEmployees is a globally declared recordset in a standard module
- RFC is unique to each employee
Now, I'm sure there has to be a different approach...I just haven't found it.
Maybe with the DataBindingBehavior property? If so, How?
Thanks in advance!
My question is, How can I bind a module instance (element of a collection) to a certain record in an open db?
Suppose I have a collection class called Employees, that holds Employee classes. Now, if I modify a property in the class Employee, or if I add a new entry using the Add method of the collection Employees, how do I update/add the record in the database?
I'm currently using the following approach:
' Example snippet from the Employee class
Public Property Let RFC(NewValue As String)
msRFC = NewValue
grsEmployees.Find msRFC
grsEmployees.Fields("RFC") = msRFC
End Property
Notes:
- msRFC is privately declared as a "String" in the Employee class/module
- grsEmployees is a globally declared recordset in a standard module
- RFC is unique to each employee
Now, I'm sure there has to be a different approach...I just haven't found it.
Maybe with the DataBindingBehavior property? If so, How?
Thanks in advance!