Passing a Form name to a module 
Author Message
 Passing a Form name to a module

I have a module which i need to pass a form name.  If a pass astring
variable set to the form name the module gives me a 424 error.  Hardcoding
the form name in the module works but I need the flexibility to send variuos
form names at various times.


Sun, 17 Feb 2002 03:00:00 GMT  
 Passing a Form name to a module
Hi,

To pass a form's name as a string, use:

dim strFormName as string
strFormName = "theForm"
Forms(strFormName) etc...
or directly
Forms("theForm") etc...

Hth,
Radu Lascae


Quote:

> I have a module which i need to pass a form name.  If a pass astring
> variable set to the form name the module gives me a 424 error.  Hardcoding
> the form name in the module works but I need the flexibility to send variuos
> form names at various times.



Mon, 18 Feb 2002 03:00:00 GMT  
 Passing a Form name to a module
You'd have to send the code you are using in your module in order to check
for correct usage ...

--
HTH/EQTA
Mario Osorio
--
You'll find good answer to common
and not so common questions
at Dev Ashish's site. <=>
Ud. encontrar buenas respuestas
a preguntas comunes y no tan
comunes en la pgina de
Dev Ashish:
http://www.mvps.org/access
--
--



: I have a module which i need to pass a form name.  If a pass astring
: variable set to the form name the module gives me a 424 error.  Hardcoding
: the form name in the module works but I need the flexibility to send
variuos
: form names at various times.
:
:



Mon, 18 Feb 2002 03:00:00 GMT  
 Passing a Form name to a module
Both of these should work from any module attached to a form:

1.  Call GetFormName(Me.Name)
        Function GetFormName (strForm as String)
        End Function

2. Call GetForm(Me)
        Function GetForm(frm as Form)
        End Function


Quote:

> I have a module which i need to pass a form name.  If a pass astring
> variable set to the form name the module gives me a 424 error.  Hardcoding
> the form name in the module works but I need the flexibility to send variuos
> form names at various times.



Tue, 19 Feb 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Passing Form-Object Names to Module Code

2. Passing input box value from Form Module to report module

3. Forms Collection: Using it to Open Forms by Passing the Form Name as a String Variable

4. Pass variable form module to a form

5. How do you pass from obj from one form to a module/forms

6. passing forms and controls so I can set focus back to a form from a module

7. passing forms and controls so I can set focus back to a form from a module

8. How do I open a form by passing the Name of the form as a string

9. Passing Value from Module Function to Form sub problem

10. Module works, except when form passes arguements

11. Passing variable from form to module??

12. Passing data between a user form and code module

 

 
Powered by phpBB® Forum Software