E
ericb
On the main form are several control buttons that open different forms that
then open other forms and reports.
All this works fine.
But I would like to declare an array of string that would be available to
all forms and report alike. The reason is if I change the name of a product I
don't have to go through all of the code to change strings all over the place
and for sure I will forget one.
To do that I added a class module and put this in it :
Option Compare Database
Const nb_prod As Long = 6 ' Nb de produit disponible
Dim lst_produit(6) As String ' Les produits
lst_produit(0) = "OP"
lst_produit(1) = "BM"
lst_produit(2) = "CP"
lst_produit(3) = "CM"
lst_produit(4) = "SP"
lst_produit(5) = "OPL"
' Les index
Const prod_OP As Long = 0
Const prod_BM As Long = 1
Const prod_CP As Long = 2
Const prod_COM As Long = 3
Const prod_SP As Long = 4
Const prod_OPL As Long = 5
and nothing works.
1- I am not initializing lst_produit properly
2- From the main form I am not able to see (or use) lst_produit
Where do I put and how do I make such an array ans const
Thank you for the HELP
Eric
then open other forms and reports.
All this works fine.
But I would like to declare an array of string that would be available to
all forms and report alike. The reason is if I change the name of a product I
don't have to go through all of the code to change strings all over the place
and for sure I will forget one.
To do that I added a class module and put this in it :
Option Compare Database
Const nb_prod As Long = 6 ' Nb de produit disponible
Dim lst_produit(6) As String ' Les produits
lst_produit(0) = "OP"
lst_produit(1) = "BM"
lst_produit(2) = "CP"
lst_produit(3) = "CM"
lst_produit(4) = "SP"
lst_produit(5) = "OPL"
' Les index
Const prod_OP As Long = 0
Const prod_BM As Long = 1
Const prod_CP As Long = 2
Const prod_COM As Long = 3
Const prod_SP As Long = 4
Const prod_OPL As Long = 5
and nothing works.
1- I am not initializing lst_produit properly
2- From the main form I am not able to see (or use) lst_produit
Where do I put and how do I make such an array ans const
Thank you for the HELP
Eric