Solved

Form won't load

Posted on 2000-04-06
11
193 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 142

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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now