Results 1 to 2 of 2
  1. #1
    DevSteve is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2012
    Location
    Rockville, MD
    Posts
    2

    Create new form instance at the module level

    I'm trying to create a new instance of an existing form, set it's record source, and display the form for the user. I can create the instance and display it, but as soon as the code stops executing the form instance goes out of scope and disappears. I've read that I need to... declare the variable that represents the new instance of a form class at the module level, which I mostly understand, but how do I actually do this?



    I created a module, and a public sub to create the new form instance, then I call the sub from a procedure connected to a form (where the selects options). However, again my new form instance is gone when the code stops.

  2. #2
    DevSteve is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2012
    Location
    Rockville, MD
    Posts
    2
    I needed to add the new instance to a public collection. Then I could keep the form in scope.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Create a new Word-instance, probs with Citrix
    By chappy72 in forum Access
    Replies: 1
    Last Post: 01-11-2012, 05:30 PM
  2. Replies: 4
    Last Post: 05-16-2011, 04:58 PM
  3. Create Foreign Key From VBA Module?
    By CrazyFileMaker in forum Modules
    Replies: 5
    Last Post: 01-03-2011, 06:34 PM
  4. Create module to add field
    By DavidAlan in forum Modules
    Replies: 3
    Last Post: 09-08-2010, 09:18 AM
  5. Multiple Instance Form
    By steve.roic@bellsouth.net in forum Forms
    Replies: 0
    Last Post: 05-19-2010, 11:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums