Results 1 to 5 of 5

Thread: Is the Form On Screen

  1. #1

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024

    Is the Form On Screen

    I have a function that clears a form and puts it to the screen. How do I check to make sure the form isnt already on the screen so .show will not blow up?
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Is this .Net?? If not then in VB6 .show will not "blow up" no matter how many times you use it. Here is VB6 code you can use if you want to check anyhow.

    VB Code:
    1. Dim frm As Form
    2.  
    3. For Each frm In Forms
    4.     If frm.Name = frmToLookFor Then
    5.         Exit Sub
    6.     End If
    7. Next
    8. frmToLookFor.Show

  3. #3

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Actually I found out its Access 2000.

    I will try what you suggest
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  4. #4
    Software Eng. Megatron's Avatar
    Join Date
    Mar 1999
    Location
    Canada
    Posts
    11,286
    What do you mean by "Blow up?"

  5. #5

    Thread Starter
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Wow, if it isnt the almighty megatron
    Its been a long time since I have had help from you.

    Anyways, I am trying to clean up someone else's work on another project. Its a Access 2000 & Excel 2000 VBA project. For some stupid reason they didnt use VB to start with. Since there doesnt seem to be an easy way to convert VBA to VB I seem to be stuck fixing up their VBA program .

    I cleaned up the same problem in Access, but now I am getting it in Excel, and I cant find a way to stop it. The probelem is, there is a function that clears a form, adds some text & stuff to it, then displays it. It works fine if the form is not currently showen. But if it is on screen I get:

    Show method of DialogSheet class failed

    Then it crashes. Thats where I am now.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


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