Sorry, my english isn't good enough to say my problem in a few words. This is what I want to do:
I want to make a generic 'class' all my forms are based on, so I can dynamically make a recordset for the form and lots of other things like creating dynamically searchstrings. Therefore I want to declare a couple of variables in a form, and have a central module build a select string based on these variables. this is what I think of now:
Dim fv_meRst As New ADODB.Recordset 'recordset of the form
Dim fv_mainTable As String 'maintable the form is based on
Dim fv_subTables(99) As String 'subtable, will be joined on the maintable
Dim fv_aantSubtables As Integer 'number of subtables
Dim fv_subTablePrimaryKey(99) As String 'primary key of the subtable
Dim fv_foreignKey(99) As String 'foreign key on the maintable
Dim fv_alias(99) As String 'alias of the subtable, in case of having a subtable declared twice
Dim fv_subTableOuterjoin(99) As Boolean 'do a outer join on a subtable or an inner join?
on the form_open, I want to call a function on a main module that builds the select query based on these arguments given. Only problem is: how can that module reach these variables? These variables are declared in the header of a form-module, not in a sub.
I hope the above is clear enough to answer my question!
Thanks!
Tom
I want to make a generic 'class' all my forms are based on, so I can dynamically make a recordset for the form and lots of other things like creating dynamically searchstrings. Therefore I want to declare a couple of variables in a form, and have a central module build a select string based on these variables. this is what I think of now:
Dim fv_meRst As New ADODB.Recordset 'recordset of the form
Dim fv_mainTable As String 'maintable the form is based on
Dim fv_subTables(99) As String 'subtable, will be joined on the maintable
Dim fv_aantSubtables As Integer 'number of subtables
Dim fv_subTablePrimaryKey(99) As String 'primary key of the subtable
Dim fv_foreignKey(99) As String 'foreign key on the maintable
Dim fv_alias(99) As String 'alias of the subtable, in case of having a subtable declared twice
Dim fv_subTableOuterjoin(99) As Boolean 'do a outer join on a subtable or an inner join?
on the form_open, I want to call a function on a main module that builds the select query based on these arguments given. Only problem is: how can that module reach these variables? These variables are declared in the header of a form-module, not in a sub.
I hope the above is clear enough to answer my question!
Thanks!
Tom