|
| |||||||||
| Tags: dot net, form, text field, visual studio |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| To access a text field from another form I am working with Visual Studio, dot net forms. I have 2 forms Form X & Form Y. I am opening Form Y on Form X using ShowDialog(). Now what I am looking for is a way to access a text field on Form Y(Called form) to Form X(Calling form). Please help me in this situation. |
|
#2
| |||
| |||
| Re: To access a text field from another form
Hi, Can you tell us with some details what you exactly want to achieve? Thanks, |
|
#3
| |||
| |||
| Re: To access a text field from another form
For a ShowDialog form I mostly use simple "friend" fields in the showdialog form, that gives me the most flexibility. this is not correct but I do this only by one time to use ShowDialog forms. |
|
#4
| ||||
| ||||
| Re: To access a text field from another form
Use the overload on ShowDialog() and pass in the calling form as the owner. Now from the called form you can access a public member on the calling form. Code: Dim owner = TryCast(Owner, Form1) If owner IsNot Nothing Then '// Do something cool with the form End If |
|
#5
| |||
| |||
| Re: To access a text field from another form
what you're trying to do could be done for free by Access by setting up a query containing the tables for both forms - they must be related, surely? |
|
#6
| ||||
| ||||
| Re: To access a text field from another form
When you want to open the second form, from say a button click, use code like this on the button in the first form: DoCmd.OpenForm stDocName, acNormal, , , , , Me.boxFID Where stDocName is the name of the second form and Me.boxFID is the field that contains the value you want to pass. The commas are all needed, they are for different options when opening a form. Then use code like this in the 'on open' event of the second form: If Not IsNull(Me.OpenArgs) Then Me.boxFinder.Value = Me.OpenArgs Me.Requery End If Me.OpenArgs will be equal to whatever value you passed from the event in the first form. |
|
#7
| ||||
| ||||
| Re: To access a text field from another form Code: form2.text1.text=text1.text |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "To access a text field from another form" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Disabling a Text Field In JSP | Sheenas | Software Development | 5 | 1 Week Ago 04:08 PM |
| Switch the 'action' field in an HTML form | MarceloQuad | Software Development | 4 | 07-02-2010 05:05 AM |
| Multi Field value field in Microsoft Access | Erubiel | Windows Software | 3 | 19-11-2009 11:55 PM |
| How to validate form field before execution of a servlet service method | Quattro | Portable Devices | 3 | 11-09-2009 03:28 PM |
| Disable yellow autocomplete form field | teenQ | Technology & Internet | 3 | 06-08-2009 09:57 PM |