Hello, I have a question concerning pasing an argument in the form of a string then converting that string into an object part.

THis question is concerning Acess 2003 and VBA.

Setup:

Form 1 named: frmMyform

in the VBA code on this form i call a function in a Module.
dim formName as string
formName = Me.Name (thus setting formName to "frmMyform")

Function call: myfunction (formName)

------------------------------------

In module i now have the function that recieves the name...


I wish to use the name in the following manner...

dim frm as form
set frm = Forms!formName <------------- Notice how i use the passed variable "formName"... Access tosses an error about it being a string and not part of the object command.


I need to convert the string into the apropriate object type to turn it into a form.

any help would be apreciated.