FormOpen vs FormLoad

A

Amit

Hi,

I'm opening "formA" through a button in "formB", and
passing a value to it using OpenArgs.

I'm curious as to where should the OpenArgs be checked
in "formA" and assigned to a control - in OpenForm or
LoadForm? Will it make a difference? How?

Thanks!

-Amit
 
M

Marshall Barton

Amit said:
I'm opening "formA" through a button in "formB", and
passing a value to it using OpenArgs.

I'm curious as to where should the OpenArgs be checked
in "formA" and assigned to a control - in OpenForm or
LoadForm? Will it make a difference? How?


FormA can retrieve it's OpenArgs property value at any
point, so you can use it just about anywhere you want. If
you're doing something really tricky with OpenArgs, it might
be a good idea to process it in the Open event and set some
module level variables for later use.

If you want to assign a value to a control on the form, you
should wait until the Load event (the Open event is too soon
to do this). However, you can set many other control
properties (e.g. Visible) in the Open event.
 
A

Amit

Thanks Marsh. Your reply was helpful.

-Amit
-----Original Message-----



FormA can retrieve it's OpenArgs property value at any
point, so you can use it just about anywhere you want. If
you're doing something really tricky with OpenArgs, it might
be a good idea to process it in the Open event and set some
module level variables for later use.

If you want to assign a value to a control on the form, you
should wait until the Load event (the Open event is too soon
to do this). However, you can set many other control
properties (e.g. Visible) in the Open event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top