A basic Access question about calling a sub from a button
Hi all!
I have this form on which lies a button that calls another form. Very simply, in the On Open event of this button, I call a sub that will open the form, as follow:
=Open("frmMyForm")
Now the code read something like this:
Function Open(MyForm As string) As Integer
Select Case MyForm
Case "frmMyForm"
DoCmd.OpenForm MyForm
bla bla bla...
Can I pass the form as an object instead of a string? If so what do I have to change in the above?
I tried (and tons of variations):
=Open(frmMyForm)
Function Open(MyForm as object)
with no obvious result.
Anyone's two cents would be appreciated.
p.s. Access 2000
Re: A basic Access question about calling a sub from a button
Seems like your going about this the long way? If you pass the Form as a Form then there is no need for a select case statement. Just
the call to open the form.
DoCmd.OpenForm "MyForm"
Re: A basic Access question about calling a sub from a button
Hi there Rob,
I was really looking into how to pass diff. arguments type to a sub using the OnEvent property, beside from string type as in =MySub("frmname") ,well if it is possible.
I presume I went asking about this the wrong way. I couldn't care less about opening a form.
lol