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?
Printable View
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?
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:
Dim frm As Form For Each frm In Forms If frm.Name = frmToLookFor Then Exit Sub End If Next frmToLookFor.Show
Actually I found out its Access 2000.
I will try what you suggest
What do you mean by "Blow up?"
Wow, if it isnt the almighty megatron :D :wave: :rolleyes:
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 :mad:.
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.