form.show and pass parameter to the form

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

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
 
Hi,

Doesnt this work?

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

Ken
-----------------------
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
 
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
 
Agnes said:
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
 

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

Back
Top