Results 1 to 3 of 3

Thread: Forms Problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Isle of Man
    Posts
    276

    Question

    I'm converting an access program into VB. The app has many screens that can be accessed in many orders. The names of the screens are placed in a stack, so they can be displayed in the right order.

    the name of the from is retreived, and stored in the string DocName, and the VBA code uses

    docmd.openForm DocName, , , LinkCriteria

    to display whatever form is needed next.

    This may sound like a stupid question, but how do I get VB to show the form who's name is contained in DocName????

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    don't store the name of the form as a string. Store a reference to the form. e.g.

    Code:
    Dim DocName as Form
    
    Set DocName = Form1
    
    'then when you need to show it.
    DocName.Show
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Isle of Man
    Posts
    276

    some progress at last....but...

    that seems to work, but....

    it turns out that the stack used to store the form names is a table in a database

    when i try and assign the contents of the relevant field, eg

    DocName = MySet!PreviousScreen

    i get 'invalid property value'

    if i try the more sensible sounding

    DocName.Name = MySet!PreviousScreen

    then i get 'cant assign to read only property'

Posting Permissions

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



Click Here to Expand Forum to Full Width