Exchanging Data Between Two Forms?

Jul 9, 2011

i'm working on a project and i need to know how to exchange data between two forms,so like there's two forms one loginform and other the main form and if the login is correct,a boolean will be set to "true" .the problem is you have to dim the boolean twice, each in the two forms,so there's no way to exchange the data.i tried it so that if the login is successful,a textfile is created and then the main form detects the text file automatically,

Public Class Form1
Dim sdata As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As

[Code].....

View 5 Replies


ADVERTISEMENT

Variable Value Exchanging Over Seperate Forms?

Aug 4, 2011

How do i go about making variables on a second form have the same value as in the first form while still being able to make the variable on the first any given word or phrase and it appear the same on the second form?

View 2 Replies

Forms :: Share Data Between Forms (as Opposed To Passing Data)

Nov 26, 2011

Quite a few threads on passing data from one form to another, but I'm struggling to work out how to share data between the two - back and forth.

For example:

Class1 is a class with 10 string properties

Form1 has 10 labels ("Label1", "Label2" etc) and a [Configure] button.
Form2 has 10 textboxes and a [Apply] button.

I want to load with Form1, and create an instance of Class1. Click the Configure button and load Form2, passing Class1. On Form2 I want to manually fill in the 10 textboxes and hit Apply. The Apply should update the Class1 instance and close the form.

Form1's Label controls should then be updated with the data from the Class1 instance.

I'm fine creating the forms and classes, as well as passing the class into Form2 with a custom Sub New(EmptyClass as Class1) constructor. This gets the empty class into Form2, but how can I get the populated class back to Form1?

As Form1 already exists I don't want to create a new instance with another custom Sub New(PopulatedClass as Class1)

It's also key to be able to use the Form2 multiple times, basically ending up with a Data class being displayed as part of Form1 but updated using Form2? (For example if the Class has already been created and populated with data when it's passed back to Form2 for the second time I would pre-load the Textboxes with the values already in the class).

View 3 Replies

Passing Data Between Forms Without Any Public Methods Or Properties On The Forms

Dec 28, 2009

Passing data between forms without any public methods or properties on the forms. everything but the "Controller" class, which I would like you furnish. I just changed the title from "Intermediate" to "Beginner" This solution is an example of the Observer Pattern. The "Controller" class is the "observed" class, which in this case means it publishes events.

' File Definitions.vb

Public Delegate Sub MessageDelegate(ByVal sender As Object, ByVal e As MessageEventArgs)

Public Class MessageEventArgs : Inherits EventArgs
Public Message As String

[CODE]...

The program should initially display Form1, and Form2. Clicking of the button on either form will modify the Title Text of both forms. I think that you will find the final end result to be pretty neat, as it works with any number of open forms not just two. I think asking for the Controller class is easier than asking for the code in the forms. My solution for Controller class has 7 lines of content, 9 lines if you include Class, EndClass. A minimal solution could achieved with only 4 lines of content, but it would a textbook example of bad programming.

View 12 Replies

Create A Data Forms With Forms Wizard In VB 2005?

Jan 21, 2010

How to create a data forms with the data forms wizard in VB 2005

View 6 Replies

Forms :: Retaining Data Across Multiple Forms

Sep 8, 2010

VB.NET newbie here... I have an vb.net windows application set up. It has multiple forms, about 6 in all. There's a main menu form, and then 5 other forms to collect data. The user will collect data on each form and bounce back and forth between forms. How do I get the forms to retain the data that has been entered into the text boxes and/or other controls on the forms? For example, they might fill out a few textboxes on a form, but then need to go to a different form and fill something out... and then back to the previous form. Right now, when they come back to the form, all the data previously entered in to the text boxes is gone.

View 1 Replies

Input Several Boxes Of Data On One Form And Display Individual Pieces Of That Data On Several Other Forms

May 22, 2009

I have just started with vb and would like to know if there is a way to input several boxes of data on one form and display individual pieces of that data on several other forms at timed events in the future?

View 1 Replies

Forms :: Display Data In Grid View Using Code That Can Edit, Update And Delete The Data?

Oct 6, 2011

how to display data in grid view using code that you can edit, update and delete the data...do i need to have a stored proc in this?

View 4 Replies

Forms :: Populate A Data Table With Some Data From Text File

Mar 29, 2010

Here is the code that I already have:

[Code]...

View 4 Replies

Forms :: Passing Data Between Forms?

Nov 12, 2009

I have a gridview on a form pulling user data. I have also created a basic login system where users login and their username/password is checked against a table in SQL Server 2005.The gridview is on Form 2 but i am having great difficulty in returning the records in the gridview for the user that is currently logged in.

View 3 Replies

INSERTING - Accepting Both The Forms Data And The TabControl Data

Jul 22, 2010

I am INSERTING into 2 different tables with 2 different buttons (One after the other by clicking each button). I have a form with 1 button directly on it to INSERT into tblCustomers from a field that is directly on the form as well. I then have a TabControl with another button with other fields (5 to be exact).

After I add data to the data base by filling out the field on the form and then by first clicking the add button located directly on the form and then add data to the fields directly on the TabControl the data will not INSERT itself into the tables in the data base for the 2nd table. Only the first table get data in it and not the one related to the TabControl.

BUT if i add data in the TabControl and then click the button on the TabControl it adds data into to the 2nd table. Is there a way to refresh my program so that it will accept both the "forms data" and the "TabControl data"?

View 3 Replies

Forms - Copy Data Between Data Grids?

Mar 7, 2012

i'm trying to pass a variable between two datagrids. The first is on an main form, and the second is in a dialog form.

I tried using functions and also through public variables like this:
Invoice_new (Parent FORM):

Controls:

DatagridView: invoice_items
Public WriteOnly Property ValueFromChild() As String
Set(ByVal Value As String)

[Code]....

View 1 Replies

Forms :: Changing Data In An Xml Tag?

Jun 8, 2012

I have the below code that can change the data in one XML tag. This is what I want,however, I want it to change all the XML's in a complete directory:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim MyXML As New XmlDocument()

[code].....

View 1 Replies

Handling Data Between Different Forms?

Apr 29, 2010

I'm writing a simple application - address book. User enters new addresses and they are added as an entry to a list visible on the main form (frmStart). I use one form to add and edit (AddContForm). Add button on the frmStart works fine, however I experience some problems with the edit button as when I press it and enter new data they are added as new entry however the previous entry is still there. Logic is handled by Contact.vb class.

Contact.vb
Public Class Contact
Public Contact As String
Public Title As String

[code]....

Update:I really don't care much for whether the data on the AddForm is the old data or the new data. I think the problem now is that when I click edit previous entry on the list is not deleted (what I believe I have indicated in my question) - I tried to delete it (by using the if condition and checking what button was pressed) however it seems it is not working properly for some reason.

View 1 Replies

Linking Data Between Forms?

Jan 29, 2009

I have one main form and another dialog box that is used to search records. What code is used to declare a public variable in the dialog box form in order to get the record found by the user displayed back into the main form?

View 4 Replies

Pass Data Between Forms?

Oct 3, 2011

Is this way a "right" way to pass data between two forms?[code]...

View 1 Replies

Passing Data Between Forms

May 10, 2010

I have 2 forms. Using Visual Basic.On Form 1 there is a populated combo box. This was done so by running a query through it and populating it with PUZ_ID values from a data set.On form two there is a tool strip and below is a search query.I need to be able to select the value i want in the combo box on form 1, and launch a button that opens form 2, which has loaded the data that i binded onto the form.Anyone have any ideas/code or need me to clear this up a bit more?So i need to run something through a query, or make something public or what?

View 2 Replies

Passing Data Between Forms?

May 10, 2010

I have 2 forms. Using Visual Studio.

On Form 1 there is a populated combo box. This was done so by running a query through it and populating it with PUZ_ID values from a data set.

On form two there is a tool strip and below is a search query.

I need to be able to select the value i want in the combo box on form 1, and launch a button that opens form 2, which has loaded the data that i binded onto the form.

So i need to run something through a query, or make something public or what?

View 2 Replies

Sending Data Between Forms

Dec 1, 2010

i have a similar question so i thought i might post it here rather than clutter the place with a new thread, if that's okay.first off, i'm using VB 2010 Express, if that makes any difference.second, i'm trying to send data to form2 from form3 rather than the other way around. i'm still pretty much new to VB, but have a lot of experience in PHP and some in java. i'm making a basic program that creates critters on form3 and then adds them to a table on form2.[code]then adds a value of 1 to the progress bar (i still am trying to figure out how that works) on form2.

View 3 Replies

Sharing Data Between Forms?

Nov 17, 2009

I am working with several RFID readers that perform different function in my vb.net program. Currently each reader port number is hard coded into the respective form. For example, reader 3 operates on COM1. However, this will be problematic when installing on different machines.

What I would like to do is have a "configuration" form where the user can select each reader and then select the COM port. Then all other code references these settings. What would be the best approach for this.

The only way I know to do it currently is to place this information in a small database and then have the forms reference that database, but it is a lot to do for such a seemingly trivial task.

View 3 Replies

Tables And Data On Forms?

Nov 19, 2011

I am engaging to build my first project with a database connection and have a question before I go any further:In MS Access when you create a form you have the option to put a subform in and link the data so that each time the main record changes that sub data changes too.My Database and table are complete and ready to go. There are perfectly normalised as well.How can a similar procedure be achieved in VB.Net ?

View 5 Replies

Transfer Data Between Two Forms

Sep 28, 2010

I'm currently working on a simple Jeopardy game in visual basic. My selection choices are made from picking the proper radio buttons. Questions is; how do I connect the two forms (form_1 & form_2) so that is will show the proper points after answering a question? I'm using lbl or txtbox for bank total after each question.

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
'contestestant "Max" choice
If RadioButton1.Checked Then
[Code] .....

View 2 Replies

Change Data Source For Forms?

Jan 27, 2009

I have a two forms with about 25 bound controls on each in the same solution. All of the data for both forms is in the same SQL table. I need to filter the data and only get the data appropriate to the called form. I consulted an University VB professor and he would only say "it won't be easy".

I tried removing all of the bindings and rebinding them to the new datasource but there were still some remnants (probably from the navigator) that proved illusive.

Is the only solution to recreate the VB forms and bind them to the new datasource?

(using Visual Studio 2008 Professional)

Private Sub HazMatlLabelsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HazMatlLabelsBindingNavigatorSaveItem.Click

[Code]...

View 1 Replies

Create And Save Data To New Forms?

Jul 1, 2010

New to vb.net coming from vba. I am working on a mass balance model which collects a handful of 'user' data (less than 10 records) and then applies various equations to the data and records/reports the resulting values. I think I have a pretty good handle on the basic operators for a single 'user', having pretty extensive vba knowledge. However, I am having difficulty saving the new 'user' data and creating new 'users'. I need to keep the app as simple as possible for deployment to machines with nothing more than 2.0 and I do not really need a database, just a simple method of creating multiple 'users' as objects.

View 5 Replies

Data Not Showing In Window Forms App

Oct 1, 2010

I am just learning vb.net using vs 2008. I have a small forms app which I have conected to a small, single table 2 column database. I enter some numbers into a text box, press a button and the data gets entered into the dbase. However the only data that gets displayed in the data table I have on my form is the existing data.No new data entered is shown until I close down and restart the app. I have tried many times using statements such as [code]...

View 9 Replies

Forms - SQL Data To Excel Spreadsheet

Dec 24, 2009

So I need to create a windows form that is able to generate reports by querying a SQL Database or SQL Server. There is data in the databases that will be put into an excel file from whatever columns from a specific table I need. I need it to be a dynamic query that is probably hard coded into the application because I might need to write other queries at some point to generate different reports that need different columns.

What I need is somewhere to start or some code that I can look at because im not very familiar when it comes to vb.net/excel. I need code to get all that data from the database and put it neatly in an excel file and I would like to specify what columns in the excel file all the data goes under.

View 4 Replies

Forms :: Copying Data To Clipboard?

Mar 27, 2011

I'm trying to program that specific data will be copied to the clipboard so the user can paste it in, for example, Excel or Word. I already know that the following code can do this:Clipboard.setdataobject( " some text " )But that's where my problem just starts. It seems I can only copy the data to Excel and Word etc. as long as my application is running. As soon as I quit it, the clipboard is empty.

View 2 Replies

Forms :: Data Loading FROM The Grid?

Jun 23, 2011

I have a grid loaded with data. What I wanna do is when you double click on the row header, the data in that row should load into a form with textboxes. I've chosen the RowHeaderMouseDoubleClick as the evnt for this but dunno how to start.

View 2 Replies

Forms :: Data Validation In Textboxes?

Dec 7, 2009

I Have four textboxes, I want textbox1 to accept only char data.I want textbox2 to accept only numeric data.I want textbox3 to accept

View 1 Replies

Forms :: Display Data In Datagridview?

Jan 19, 2010

Dear Experts

Table gpass has data as
gate-----date-----c----bno----acccode----tittle----weight-------qty
1----18/01/2010---a----2--------2----------abc-----10.00-------15

[Code].....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved