Loading a form

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
 
D

Douglas J. Steele

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top