Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Sep 2001
    Location
    NSW, Australia
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Generating forms in Visual Basic (AccessXP SP1)

    Does any one know how to programmatically generate a form and a function on the created form in Visual Basic in run-time mode? To minimise the size of our database I would like to be able to generate certain forms as required. Some forms are used about once a month in very special circumstances, therefore, to actually save them in the database is just a waste of space. I would prefer to generate them as needed and only when needed (once a month, once every two months, whenever)

    Any suggestions would be greatly appreciated.

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Generating forms in Visual Basic (AccessXP SP1)

    To give a complete reply would take too long, so I'll point out some of the most important commands:
    Use CreateForm to create a new form (it is opened in design view)
    Use CreateControl to create a new control on a form.
    Use the CreateEventProc method of a form module to create an event handler for a control.
    Use the AddFromString menthod of a Module to add code to a module.
    Type any of these terms in the Immediate window and press F1 to get help about them; you will find several useful examples.

  3. #3
    Lounger
    Join Date
    Sep 2001
    Location
    NSW, Australia
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Generating forms in Visual Basic (AccessXP SP1)

    I love this forum. <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>

    Thanks a lot Hans for such a quick reply.

    Just what the good doctor ordered.

    Thanks again

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Generating forms in Visual Basic (AccessXP SP1)

    I would suggest you reconsider. One of the problems with generating forms on the fly is that the process causes bloat in the database and there isn't a good reason I can think of to go to all the work of writing code to create a form that you will then throw away. It would be far less work to just create the form and save it and only use it once a month. A single form isn't all that space intensive and I doubt seriously that it would take more space than the code to create a new one monthly.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •