Use a global class with properties that you access as the first point in the form_load routine.
Main Topics
Browse All Topicscan we pass parameters in the Form_load procedure in VB 6.0??
If yes how??
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Create a example variable in a Module:
Public VariableID As Integer (or Global VariableID As Integer
You can give it a startup value by creating a Sub Main() in this module, and then set Sub Main()As Your Default startup Object.
Now you can give it another value or readout the value in any form from any point at any time!
Regards,
Paul
Hello,
sorry for not posting any comments...was quite busy...
in fact the solutions provided by experts here did not work..and I found the solution somewhere else...
I just had to declare the parameters in the form load as shown
dim sDisplay as string
sDisplay = Command$
then it works,
Hope it not unfair to anyone now, and now this question can be deleted..
Regards,
Priya
SerCouWisMOD,
I think that the answer to his or her question whas given by the experts that replyed to this question, as you can see by the question that whas asked: 'can we pass parameters in the Form_load procedure in VB 6.0??' then answers from Sethi:
You will have to use Global variables or Public properties in Form_Load event to set values for something on that form. You can't pass parameters to it.
From rhys_kirk:
Use a global class with properties that you access as the first point in the form_load routine.
And from me:
Create a example variable in a Module:
Public VariableID As Integer (or Global VariableID As Integer)
You can give it a startup value by creating a Sub Main() in this module, and then set Sub Main()As Your Default startup Object.
Now you can give it another value or readout the value in any form from any point at any time!
Where the correct answers to the question. The solution that he or she found is in my opinion NOT correct because if you declare a variable within the form_load state and also declare it as DIM than you could never pass the info to another form or procedure am i correct??
Regards,
Paul
Business Accounts
Answer for Membership
by: SethiPosted on 2003-12-16 at 03:56:02ID: 9948454
You will have to use Global variables or Public properties in Form_Load event to set values for something on that form. You can't pass parameters to it.