Solved

Form won't load

Posted on 2000-04-06
11
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month4 days, 23 hours left to enroll

635 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