Results 1 to 2 of 2

Thread: problem assigning form name to variable

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Neenah, WI USA
    Posts
    95

    problem assigning form name to variable

    Trying to read in a form name from Access table (working) and then load that form with code.

    Here's the code:

    Dim MyForm As Form

    Set MyForm = rs1![Form] ' rs1![Form] = "frmA"

    Load MyForm
    MyForm.Show

    Get a type mismatch error on the Set line...
    Any ideas?
    Thanks
    Steve
    vb6

  2. #2
    jim mcnamara
    Guest
    You can't do that. To load a form you have to explicitly name the form.

    Once a form exists, you can use a collection to reference the form, but until it exists (loads) you can't indirectly reference it.

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