Click to See Complete Forum and Search --> : Opening forms with parameters


Andrew_Fryer
May 29th, 2001, 03:02 AM
According to the help file frm.Show does not support named parameters. Is there any way of passing these parameters without resorting to global variables. In Access you can use

Me.openargs

to get any parameters. Is there a similar command in VB?

Thanks

Andrew

Clearcode
May 29th, 2001, 03:47 AM
If you mean to get the executable program's command line, you can use the Command$

reserved word.

HTH,
D

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com

Andrew_Fryer
May 29th, 2001, 03:57 AM
What I need is to be able to open a form with a parameter string, i.e the result from a list box which will be used in the child form.

Thanks for your help

Andrew

Clearcode
May 29th, 2001, 04:08 AM
In Visual basic you do not need to close one form when another opens. Moreover every loaded form is effectively a global class which can be accessed by other parts of the program.

For example:

'in frmMain
private Sub CommandChild_Click()
frmChild.Show vbModal
End Sub

'in frmChild
private Sub Form_Load()

If frmMain.lstValues.Text = "Customer" then
'\\ customer was selected from listbox
else
'\\ something other than customer was selected
End If
End Sub





hth,
D.

-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com