473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

form.show and pass parameter to the form

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
3 4066
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
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> ¦b¶l¥ó
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bob | last post by:
Declaring a module level form object in multiple froms within a project to show another project form causes a stack overflow and other assorted errors. Can anyone help?
10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
7
by: rickcheney | last post by:
I just changed my Access 2002 database to a SQL Server ADP project. I had a form where the user entered a value into a text box and when a command button on the form was clicked a Report was...
2
by: ano1optimist | last post by:
I have a form with a search button. I'm using command parameters to pass search criteria to a stored procedure. Here is my code: Stored procedure: CREATE PROCEDURE . @strCriteria varchar(200)...
4
by: Ron Rohrssen | last post by:
I want to show a dialog and when the form (dialog) is closed, return to the calling form. The calling form should then be able to pass the child form to another object with the form as a...
2
by: John Howard | last post by:
I am invoking a second form and would like to pass a parameter. My code is: Private Sub btnHelp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHelp.Click Dim...
3
by: Brad McMillan | last post by:
Hi: I have MS C# 2005 Express Edition and I'm trying to pass a string to a new form in my project. First I created the form, Customer, with a textbox, "textBox1", and declared a string...
10
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some...
3
by: bsturg21 | last post by:
Hello, I have a windows form that has a series of linklabels on it, and I need to have each linklabel, when clicked, open a separate windows form that has a single paramter passed into it. The...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.