|
-
Mar 10th, 2004, 01:26 PM
#1
Thread Starter
Fanatic Member
"errors during load" message on form with Toolbar
Hi there;
I am having a scary VB day here at work having encountered an error that apparantly numerous others have seen, but each time I acces an article from this forum (or another), there is no solid answer. So let's try again!!......
The form in question is an MDI form that has a toolbar. This is what the log records:
Line 177: Property Left in Toolbar1 could not be set.
Line 177: Property Width in Toolbar1 could not be set.
The error appears when running from the VB IDE, but does not appear in a compiled version. I have already ruled out the following possible explanations:
1. I am not referencing these properties anywhere (they are read only)
2. I have verified that the library has not changed for the toolbar.
Here is some additonal info that MAY be pertinent:
When the form loads initially, there is no error. It is when the user exercises the option to log into another 'garage' (its an app that manages workorders for fleets of leased company vehicles) and the form reloads....here is the code that does this:
If MDIForm1.Visible = False Then
Unload Me
MDIForm1.Show
Else
bNewLogin = True
Unload Me
Unload MDIForm1
MDIForm1.Show
End If
So I check if it is the first time logging in, otherwise the form is unloaded and then reloaded. The reason this is, is because when they log back in to another garage, they can change languages - so the captions need to be reset and a bunch of variables reinitialized. What's weird is that I did not change any code today - I was testing only, when suddenly this error started appearing. An answer will quite possibly result in the naming of my next born after the person who provides it - HELP PLEASE!!!!
Thanks much
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
Mar 10th, 2004, 03:20 PM
#2
How is the "Me" form in you code sample related to the MDIForm?
-
Mar 10th, 2004, 03:46 PM
#3
Thread Starter
Fanatic Member
The user is initially presented with a form that lists the different garages. They double click on one (list box) and this form (ME) unloads, and the main form, MDIForm1 loads (should have mentioned that I guess - sorry!)
All of us here are completely stumped. We are theorizing a bug with the IDE in VB - is this possible? Perhaps I should also mention I am running Windows XP on the box where I develop (grasping at straws now!) - any thought would be appreciated.
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
Mar 10th, 2004, 03:54 PM
#4
Usually problems that occur one place but not the other are due to the exe being faster (although the norm is that the problem occurs in the exe and not in the IDE). You might try the standard solution however and that is to place a DoEvents statement just prior to where the error occurs.
-
Mar 10th, 2004, 04:23 PM
#5
Thread Starter
Fanatic Member
Thanks very much for your reply Marty - I tried placing the DoEvents statement right before the error, but alas - it persists. But I have noticed something I did not before.....I have menu options that match each toolbar button - because the sub in question (for the toolbar) is only two lines, I do not call a procedure from each spot - I just copied in the two lines into the menu click event - and the error does not happen when I perform the same action from the menu - it only happens when I do it from the toolbar. So I guess it must have something to do with the toolbar (MSComctlLib). Man this is a weird one - especially considering I have been testing this app over the past week without changing the code - and suddenly it starts today. Thank god it doesn't do it in the EXE!!! Below are the two lines of code previously mentioned:
<vbcode>
select case Button.Index
case 1
bChangeGarage = True
frmDivision.Show 1
. . .
</vbcode>
frmDivision is the form previously referred to as 'ME' in the last code snippet......So I tried the following experiment:
I commented out the code for the toolbar and added:
call mnuChangeGarage_Click
And this worked!!! No error at all!!
I went back to the IDE and changed it back. When I ran it again this time, I was prompted to resave the MDIForm1 that has the toolbar. I did so, and it works fine now. And just to make sure, I closed the project and reopened it - guess what - the error returned. I think I need a rubber room (or maybe a few stiff drinks after work today!!!)
It seems to go away when I resave the form, but returns each time I reopen the project. The EXE is fine, but I am concerned: what lies ahead? Will this start happening with the other toolbars and forms? Will I need to pull hair I don't have out of my head? And how long will it be before I won't be able to recompile it with changes? At any rate, thanks again for your thoughts - any further would be welcome.
"Knowledge is gained when different people look at the same information in different ways"
- Louis Pasteur
-
Mar 10th, 2004, 05:05 PM
#6
Is there some way you could attach a zip file containing the project?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|