Loading a form

  • Thread starter Thread starter Cox Newsgroups
  • Start date Start date
C

Cox Newsgroups

Maybe its me, but in the 2003 version of Access and VBA it was possible to
load and unload forms programatically i.e. :
Load(formName)
Unload(FormName)

Is there a way to do that in 2007. When I try to use these functions, it
says cannot load this object.

If not, how do you do it?

I would like to set a form object to a variable, and DoCmd.OpenForm doesn't
return a hanle
 
The Load and Unload methods were only for UserForms, which are different
than Access forms.

To set a form object to a variable, use:

Dim objForm as Form

Set objForm = New Form_nameofform

In other words, if you've got a form named frmClient, you'd use

Set objForm = New Form_frmClient

If you're hoping to control multiple instances of the same form, see what
Allen Browne has at http://www.allenbrowne.com/ser-35.html
 
Back
Top