473,805 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8593

"Geoff" <gf****@freenet name.co.ukwrote in message
news:_L******** ************@br ightview.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(Pointe r 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.InitF orm(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****@freenet name.co.ukwrote in message
news:_L******** ************@br ightview.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
5806
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. How do I do this in VB.NET? Just hiding a form won't do as I need the logic in the OnLoad event to execute when the form loads each time. -- ------------------------------------ Wayne Wengert wayne@wengert.org
5
1823
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 still use the UI components displayed earlier when i loaded the Assembly. How is this possible, it should not show up or throw some exception when i use the controls right? Please advice me how this behavior is possible even after i unloaded the...
6
4503
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, but I've just started playing around with separate AppDomains and I'm finding that I'm not having problems where I expected I would, so maybe someone can help me understand a bit better. I've read that objects instantiated in separate AppDomains...
4
6956
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 page, setting the usercontrol's visible to false still fires the Page_Load event. Isn't this unnecessary overhead when it doesn't even show in my page.
2
1980
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 forms will load and others won't. Those that won't load at startup don't load with the Show or ShowDialog command either. Can anyone give me a hint as to what went wrong?
3
3657
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 allowing me to use frmMain.Load(). What can I use to load the main form, then unload the splash screen? Or should I, perhaps, load an invisible control form that first loads the splash screen, waits five seconds, then unloads it and loads the main...
1
2439
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 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.
6
2226
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 fine ;) ) - If I have several pages all using 'somejs.js' file this file is shared on disk and is downloaded only once... but how about in memory, is it also shared and just loaded once? -Also, when are the .js files unloaded from memory?
3
1135
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 screen for 2 seconds then executes the following commands:
3
1494
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 only what is necessary). Is it unreasonable to think that an application should be able to load and unload assemblies during runtime? I found a CodeProject article on this and it was a VERY involved solution -- not sure how "worth" it,...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.