473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Loading and unloading forms

VB6. When selecting from drop down menu options I display different forms by
using the Load (filename) and leave the form with Unload(Filename)

The Load event allows me to program the opening of a particular direct
access file and the Unload event lets me program the closing of the file.
Things are kept 'tidy' this way.

My problem is that I want to pass in a parameter when a particular form
loads. This will control which record is to be displayed. I want Pointer
to come in as a parameter.

Eg Seek #1, Pointer

Get #1, , MembRec

How do I do this?

Your help is appreciated

Geoff
Nov 5 '06 #1
2 8578

"Geoff" <gf****@freenetname.co.ukwrote in message
news:_L********************@brightview.com...
VB6. When selecting from drop down menu options I display different forms by
using the Load (filename) and leave the form with Unload(Filename)

The Load event allows me to program the opening of a particular direct
access file and the Unload event lets me program the closing of the file.
Things are kept 'tidy' this way.

My problem is that I want to pass in a parameter when a particular form loads.
This will control which record is to be displayed. I want Pointer to come in
as a parameter.
I would create a public method in the target form, and put the file opening code
in that instead. Something like
Public Sub InitForm(Pointer As Long)
' open the file...
' seek for pointer...
' get the data....
End Sub

Then in the menu code of the main form, do
Load frmTarget
Call frmTarget.InitForm(27)
frmTarget.Show

The parameters can be any type you need.

By the way, you should use FreeFile to get a file handle, not hard-code in #1,
as in
nFile = FreeFile
Open "filename" For Random As nFile
Seek #nFile, Pointer
' etc

Nov 5 '06 #2
put the code in a .bas file that way it only has to be coded once rather
than on each form. this will also solve your problem by calling things from
the .bas file on form load.

"Geoff" <gf****@freenetname.co.ukwrote in message
news:_L********************@brightview.com...
VB6. When selecting from drop down menu options I display different forms
by using the Load (filename) and leave the form with Unload(Filename)

The Load event allows me to program the opening of a particular direct
access file and the Unload event lets me program the closing of the file.
Things are kept 'tidy' this way.

My problem is that I want to pass in a parameter when a particular form
loads. This will control which record is to be displayed. I want
Pointer to come in as a parameter.

Eg Seek #1, Pointer

Get #1, , MembRec

How do I do this?

Your help is appreciated

Geoff


Dec 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Wayne Wengert | last post by:
In VB6 I used to use frmForm1.Show to make a form visible to the user and then use Unload frmForm1 to unload it. I have an app in which I need to "load" and "unload" forms based on user actions....
5
by: vineeth | last post by:
Hi I have GUI assembly which is loaded into a seprate Appdomain using AppDomain::Load method, after using it's function i unloaded the assembly by calling the AppDomain.UnLoad() method. But i can...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
4
by: John | last post by:
Hi all, I'm having a little problem understanding the concepts of dynamically loading/unloading user conrols: 1. If I have a couple of usercontrols embedded within a few tables cells on my...
2
by: Rob | last post by:
I was working on a project and everything was going fine, then all of a sudden the form set as my startup object stopped loading. I tried setting some others as the startup object, and some of my...
3
by: Eric A. Johnson | last post by:
In a new project I'm creating, I have my first form that loads being used as a splash screen, with a timer that activates after 5 seconds. I then want the main form to load. However, it isn't...
1
by: Geoff | last post by:
VB6. When selecting from drop down menu options I display different forms by using the Load (filename) and leave the form with Unload(Filename) The Load event allows me to program the ...
6
by: ernesto.tejeda | last post by:
Hello, I have a couple of questions regarding the loading of .js files for the browser and would like anyone to point me wher to find the answer (or if you know the answer and tell me will do just...
3
by: Anthony P. | last post by:
Hello Everyone, I'm writing an application that, so far, only has three forms: frmSplashScreen frmLicenseScreen frmConfigurationScreen Now, frmSplashScreen has a timer that sits it on...
3
by: -Lost | last post by:
Runtime dependency loading, worth the trouble? I've been researching methods of "dynamically" loading and unloading dependencies at runtime (trying my best to think of a nice solution of loading...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.