B
ByB
Hello,
I am working in an apàplication written in VBA and running in Access,
and I get some problems related to Object Programming. Can somebody
give me a hint in these questions :
I would like to give a Form 2 parameters when loading it. I tried with
OpenArgs, but did not find the way to pass it 2 parameters : I tried to
create a class which contains the two parameters, convert it to a
Variant by the mean of CVar() and pass it to
Application.DoCmd.OpenForm, but I get an error message about type of my
variable.
So I tried the following way (assuming that F_MyForm is the name of the
form I created) :
- Added a Let property to the F_MyForm objet (SetMyParameter)
- Dim f as F_MyForm
- Set f = New F_MyForm
- f.SetMyParameter = 12
- f. ???
This the point : I tried to find a method to call to open a form this
way, but did not find any (I have tried f.open, f.Activate, f.Show,
f.Display etc, but always got error message). So is there a way to open
a form when created this way ?
Thank you for your answers, or for telling me how to pass 2 parameters
to a form, even by the mean of OpenForm ...
I am working in an apàplication written in VBA and running in Access,
and I get some problems related to Object Programming. Can somebody
give me a hint in these questions :
I would like to give a Form 2 parameters when loading it. I tried with
OpenArgs, but did not find the way to pass it 2 parameters : I tried to
create a class which contains the two parameters, convert it to a
Variant by the mean of CVar() and pass it to
Application.DoCmd.OpenForm, but I get an error message about type of my
variable.
So I tried the following way (assuming that F_MyForm is the name of the
form I created) :
- Added a Let property to the F_MyForm objet (SetMyParameter)
- Dim f as F_MyForm
- Set f = New F_MyForm
- f.SetMyParameter = 12
- f. ???
This the point : I tried to find a method to call to open a form this
way, but did not find any (I have tried f.open, f.Activate, f.Show,
f.Display etc, but always got error message). So is there a way to open
a form when created this way ?
Thank you for your answers, or for telling me how to pass 2 parameters
to a form, even by the mean of OpenForm ...