Solved

Form won't load

Posted on 2000-04-06
11
197 Views
Last Modified: 2010-08-05
I have 2 machines - one tests the application setup.
The app has a .bas with a sub main() and this sub eventually loads a form - frmMain thus:-

....
Load frmMain

frmMain has this code:-
Private Sub Form_Load()
Dim a$, b$, c$, e As Boolean, er$, f1&, f2&, i&, j&, k1&, k2&, k$, ky0$, ky1$, ky2$, l&, m$, n$, p&
Dim r$, u$(), v As Variant, x As Boolean
Dim s5 As String * 5, s20 As String * 20, Img As ListImage
Dim cl As New Collection, sz As New Collection
Dim dt As DETAIL_TYPE, dr() As DIRECTORY_TYPE, fl As Folder

msgSplash.Label(6) = "Loading Main"
DoEvents

some of the dims are user defined types.
msgSplash is a splash from loaded in Sub Main()

If I compile it to an exe and run it on the machine it was compiled on, then no problems. But if I copy it to the other machine, it does not reach the label(6)

Previous versions have worked and I can't think what I've changed.

Any ideas.
0
Comment
Question by:broadbent
11 Comments
 
LVL 6

Expert Comment

by:st_steve
ID: 2689251
where are the data types defined?? are they defined as public types?? Any messages when you run the application on other computers?? does the application hang (stop responding)? or does it just doesn't show the form??
0
 
LVL 4

Author Comment

by:broadbent
ID: 2689338
Data types are defined in .bas file as public

What I expect to see is the splash screen with a message appearing as it goes through the program. So the splash form is visible and the last message shows "about to load frmMain" which should disappear immediately when the frmMain is loaded. Instead it just hangs with the splash form visible. No error message.

frmMain is not visible at this point.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2689382
I assume you get some error like number 530, which means that either the runtime vb is missing or some of the ocx is missing---
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:broadbent
ID: 2689397
no error number - just hangs
0
 
LVL 4

Author Comment

by:broadbent
ID: 2689409
no error number - just hangs
0
 
LVL 4

Expert Comment

by:gcs001
ID: 2689444
Have you installed all the DLL's necessary to run the VB app on the Test machine?
0
 
LVL 1

Expert Comment

by:derekcmartin
ID: 2689527
I noticed the line

msgSplash.Label(6) = "Loading Main"

so what you have is an array of labels?  

Maybe, this should be
msgSplash.label6 = "Loading Main"

If you do have an array, try

msgSplash.label(6).caption = "Loading Main"

Hope it works
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2690826
Doing a DoEvents in a Form_Load just does NOT make sense.. try changing..

From:

msgSplash.Label(6) = "Loading Main"
DoEvents

To:

msgSplash.Label(6) = "Loading Main"
msgSplash.Label(6).Refresh

To achieve the effect you want.. <smile>.

0
 
LVL 4

Author Comment

by:broadbent
ID: 2690878
I have an array of labels.
The default property of a label is caption so you don't need it. (it does work - promise)
The doevents is there to allow the label to catch up, but you may be right.

However it still hangs
0
 
LVL 14

Accepted Solution

by:
wsh2 earned 100 total points
ID: 2691011
Did you use the Packaging and Deployment Wizard to "install" your program on the second machine or just copy it over? (There is a chance your components are out of version synch, and this would correct that problem).

If you did use PDW, then did you Uninstall first before Re-Installing? In other words, physically check to make sure that the program.exe (and components) have been updated / changed to the newest version (compare file sizes, times and dates).
 
Precisely which message was the last to show? The one in Sub Main.. or the one in frmMain Form_Load? If it is the one in Form_Load, then you have a Logic problem somehere in frmMain. As you have defined a Folder Type variable, I am assuming that you are using FSO (Is SCRRUN.DLL installed on the other machine?). As every machines file environment is different, I would first check out that section of code.

Short of this.. add some testing MsgBoxes, if you checked any of the Project.. Project1 Properties.. Compiler.. Advanced Optimizations options.. uncheck them, recompile and give it another shot.
0
 
LVL 4

Author Comment

by:broadbent
ID: 2692758
I discovered this - but thanks for your confirmation. I'll do a little more work to test this as you've suggested.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question