By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

form.show and pass parameter to the form

P: n/a
in my main_form (with menubar), i can call myInvoiceForm. However, I need to
pass the parameter to the invoice form. I had declared a public property in
myInvoiceForm.
BUT,I can't set the value to the property in myMainForm. so. How can i
call the invoice and then pass the invoice not to it ???
Thanks

Private WithEvents MyInvoiceForm As Form

Sub InvoiceMenu_Click(...)...
InvoiceMenu.Enabled = False
MyInvoiceForm = New InvoiceForm
MyInvoiceForm.Owner = Me
MyInvoiceForm .Show
End Sub

Sub MyInvoiceForm _Closed(...)...
InvoiceMenu.Enabled = True
End Sub

Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

Doesnt this work?

Sub InvoiceMenu_Click(...)...
InvoiceMenu.Enabled = False
MyInvoiceForm = New InvoiceForm
MyInvoiceForm.Owner = Me MyInvoiceForm.MyProperty = MyValue MyInvoiceForm .Show
End Sub
Ken
-----------------------
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:uN**************@TK2MSFTNGP11.phx.gbl...
in my main_form (with menubar), i can call myInvoiceForm. However, I need to
pass the parameter to the invoice form. I had declared a public property in
myInvoiceForm.
BUT,I can't set the value to the property in myMainForm. so. How can i
call the invoice and then pass the invoice not to it ???
Thanks

Private WithEvents MyInvoiceForm As Form
Sub InvoiceMenu_Click(...)...
InvoiceMenu.Enabled = False
MyInvoiceForm = New InvoiceForm
MyInvoiceForm.Owner = Me
MyInvoiceForm .Show
End Sub

Sub MyInvoiceForm _Closed(...)...
InvoiceMenu.Enabled = True
End Sub


Nov 20 '05 #2

P: n/a
It doesn't work if i declare 'dim with event myInvoiceForm as form"
It works only if i declare "dim myInvoiceForm as new invoice form" <--- BUT
this didn't make the menu 's enabled = false

"Ken Tucker [MVP]" <vb***@bellsouth.net> bl
news:e8*************@TK2MSFTNGP11.phx.gbl g...
Hi,

Doesnt this work?

Sub InvoiceMenu_Click(...)...
InvoiceMenu.Enabled = False
MyInvoiceForm = New InvoiceForm
MyInvoiceForm.Owner = Me MyInvoiceForm.MyProperty = MyValue
MyInvoiceForm .Show
End Sub


Ken
-----------------------
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:uN**************@TK2MSFTNGP11.phx.gbl...
in my main_form (with menubar), i can call myInvoiceForm. However, I need

to pass the parameter to the invoice form. I had declared a public property in myInvoiceForm.
BUT,I can't set the value to the property in myMainForm. so. How can i
call the invoice and then pass the invoice not to it ???
Thanks

Private WithEvents MyInvoiceForm As Form

Sub InvoiceMenu_Click(...)...
InvoiceMenu.Enabled = False
MyInvoiceForm = New InvoiceForm
MyInvoiceForm.Owner = Me
MyInvoiceForm .Show
End Sub

Sub MyInvoiceForm _Closed(...)...
InvoiceMenu.Enabled = True
End Sub


Nov 20 '05 #3

P: n/a
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
It doesn't work if i declare 'dim with event myInvoiceForm as form"
It works only if i declare "dim myInvoiceForm as new invoice form"


That's right. If myInvoiceForm is only declared as a Form object, then your
added property will not be "visible". It will not be aware of what you've
added, since it thinks it is only a standard form.

Do you see the difference?

Best Regards,

Andy
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.