Passing Values Between Tabs In A Form In 2010?

Jan 1, 2012

I have a form with 3 tabs: one tab is for user entry and computations, a second tab shows values that will be used for computations which are read from one database (I call it settings in that the values are constants for calculations but it's not application settings in the way people think of it, to be clear) and the third displays a table from another database. The second tab has a table adapter interface for the dataset that contains values used for calculations that can be changed (to do different scenarios.) Those numbers are read from a single record in a database that has 20 fields and was read once when the data is loaded into the second tab to be displayed.

The problem I am having is that I would like to use the numbers from the second tab (the constants) in computations to be shown on the first tab. I have tried declaring the variables on the second tab as public but they are already "friends" with the form event. However, when I go to use them in calculations, it's like they don't exist.

For example, one calculation I am doing is fuel cost. The user enters miles and this is stored as a variable called mileage. To calculate the result fuelcost, I have to use two other fields that are shown in the second tab: MPG (miles per gallon) and fuelprice (the price of gas). So fuelcost = (mileage/mpg)*fuelprice. These are read from a datatable called testdata which is actually part of the project. I want to be able to use these variables throughout the program but declaring them as public isn't working.

How do I make the variables from one tab usable elsewhere in the program? The other thing I noticed is since the values of the variables are loaded into textboxes and assigned variable names by naming the textboxes, using val([variablename].text) isn't solving the problem either. For example, saying milespergallon = val(mpg.text) is not doing the trick because I am getting a message that 'text' is not an integer when I declare milespergallon.

Update Here the code that is being used:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mileage = Int32.Parse(Miles.Text)
Dim rate = 0
Dim baserate = 0

[code]....

TabPage2 is where the variables are displayed that I want to use in TabPage1.

Private Sub TabPage2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage2.Click
End Sub

View 2 Replies


ADVERTISEMENT

Spreadsheetgear Form But When Change Its Values And Do Some Calculations On Differed Tabs

Aug 14, 2009

I've got a spreadsheetgear form but when I change its values and do some calculations on differed tabs. I want to be able to save all the data and tabs at it curent state so when I open the application it is at the saved state. I'm not worried about the values before I saved.

View 3 Replies

ASP.net Form Not Passing Ddl Values

Dec 9, 2011

I have a form with 2 dropdownlists and a submit button. I want to pass the values of the lists in a URL when the list is submitted but for some reason the initial value of the ddl is getting passed. Here's my code:

[Code]...

View 2 Replies

Passing Values From One Form To Another?

Jun 22, 2010

i have a listview control on form1. I want to send the selected value to form2.

I tried couple of ways but nothing seems to work correctly.

View 6 Replies

Passing Values From Modal Form To Parent Form?

Aug 11, 2011

I am trying to pass information to parent form from modal form in vb.net winforms application.

1.) I created a copy of a form and displayed it using following code.

dim f=new frmParent()
f.show()

2.) Depending on conditions a button on frmParent opens a modal child form and asks for some informations. I used following code for that:

dim f = new ChildForm()
f.showDialog()

Both code works fine. When user press saves in child form i need to close childForm and use the user types values in parent form. I know how to close the childform but not sure how to pass info from childform to parent form.

View 1 Replies

Passing Values Within Repeater And Then To Another Form

May 2, 2011

I am trying to pass values within a repeater binding them to a button and pass them from this form to another form. When I compile this it gives me an error indicating.
System.FormatException: Input string was not in a correct format.

Button within Repeater Code in form1.aspx:
<asp:Button ID="Button1" runat="server" Text="" CommandName= "TEST" CommandArgument = '<%# Eval("Parking_ID") + "," + Eval("Parking_Name") %>' />

In form1.aspx.vb Repeater_ItemCommand Function:
Protected Sub repeater1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles repeater1.ItemCommand
If (e.CommandName = "TEST") Then
Dim commandArgsAccept As String() = e.CommandArgument.ToString().Split(New Char() {","c})
[Code] .....

View 1 Replies

Forms :: Passing Values Into Controls Of Other Form?

Sep 30, 2011

I have to ask a stupid question:How to pass values from my form into the controls of other form?I made textbox and button in my form1 and Label into the form2 When I click the button, I want to pass the values of the my textbox in the form1 into the labels of my form2

I am a student and totally new to vb.net

View 3 Replies

VS 2010 Passing Values To A Parameter In A Rdcl File?

Nov 14, 2011

In this report I put an image box named logo the select image Source is set to EXTERNAL and in the use this image I have Parameters!LogoPath.Value.I would like the users to be able to pick their own logo.

View 1 Replies

VS 2010 Passing Value To Text Box On Different Form

Jan 28, 2011

I have 2 forms... main form and AddAddress form.I use the .showdialog to open the addaddress form. When this forms adds the address to the DB it gets the autoID... but I then want to enter that autoID on a text box on the main form.

View 2 Replies

VS 2010 Display Pdf File Inside A Form That Gets Some Values From Form Controls?

Sep 27, 2010

Inside a form, I would like to display a pdf file which is already available in my resources (template file "untitled"). In this pdf file, I have some fields which get their values from some texboxes in another form. My aim is, when the user triggers the button to call this form, it should insert the values inside the pdf file and display the output pdf inside the form.I have written the code to an extend but could not finish it myself after my many trials... Now here are the two things I cannot manage:I can use a directory to read the template pdf "untitled1.pdf". But my aim is to use the file inside my resources. can save the output file in a directory but this is not I want to do. I want to display the output pdf.

View 1 Replies

Replacing The Tab Control's Tabs With Custom Tabs Made In Photoshop

Mar 16, 2009

I was wondering if there was a solution to replacing the tab control's tabs with custom tabs made in Photoshop. I know there are plenty of super expensive programs that can do it, but I was wondering if there was a way to do it programmatically. I was thinking that maybe it could linked in some way with a .DLL?

View 1 Replies

Making The GUI A Scrollable Window - Tabs Get Built, Displayed And Disposed As The User Scrolls Left And Right Through The Member Tabs?

Mar 6, 2009

My code is basically a file parser/editor and it handles most files fine as they hold a handful of records concerning family members. However there are a few files that crash when trying to deal with them. Here is the problem.Each family member record creates 3 tabs that hold an average of 3 group boxes each. Each group box holds an average of 3 text boxes.So each member record creates 3x3x3 = 27 text boxes and some files get up to 289 family members which = 7803 text boxes.

The problem is the rare file with 400+ member records = 10,800 text boxes which causes a crash due to using up all the window handles. Each member has a separate tab page (with 3 subpages) but really only a dozen or so member pages are visible in the GUI with scroll arrows to move through them so I was thinking of somehow making the GUI a scrollable window so the tabs get built, displayed and disposed as the user scrolls left and right through the member tabs.

The files are parsed into a 3d list DataList(x,y,z) where x is the page number, y is the group box number and z is the text box number. So all the data is available. The code then traverses MyList and builds GuiList(x,y) where x is the page number and y is the groupbox number with all the textbox.text linked to MyList(x,y,z) locations so all text changes are reflected in the MyList.

I already have a memberCount variable and I am thinking of building, say, the first 30 member tabs with the middle 10 being visible in the GUI. If the selected tab > 20, then dispose of the first 10 tabs and create tabs 30-40.I am thinking I will keep all the member tab pages so I don't have to deal with inserts and indexing problems but just dispose all the group boxes and text boxes for tab pages out of view. I already have a deep clone sub that clones members when the user wants to add a new family member and I am thinking I will have to add something similar when a tabpage is passed in for disposal, it traverses and disposes each text box, then disposes the group box for each group box on the tab page.Additionally, another routine will rebuild the group boxes from the data held in MyList(x,y,z) when a tabpage(x) is passed in.

View 2 Replies

Asp.net - Passing Values Between Web Forms?

May 1, 2011

Im trying to pass a value of a date control from form1 to form2.on form 1.aspx.vb:

Public ReadOnly Property Property1() As Date
Get
Return StartDate.SelectedDate[code].....

Tried to assign the property to a string, it did not work either.

View 2 Replies

Passing Values Between Forms

May 27, 2009

I think I'm getting hung up on syntax here. I've got 2 forms and am trying to pass a textbox value from the 1st form to the 2nd. The textbox value is an unique ID #, so it's an integer value in the database. The ID displays in the textbox just fine on the 1st form. When I try to access the value of this ID textbox in code in the 2nd form, I see that the value is empty, or equal to "". But I see a valid ID # on the 1st form. Here's the code that shows me that the textbox equals "".

[Code]...

View 2 Replies

Passing Values Between Forms In VB?

Jun 4, 2012

solid rundown of how this process works using custom events &EventArgs, Im really having trouble wrapping my head around it

View 14 Replies

Passing Values To Java?

May 10, 2009

I'm pulling up a a webpage in a control and the page is full of Java functions. I'm able to use execute a function using invokescript. That works out really well. But here's the thing. There's a function that takes the value of a rendered textbox and uses that data to perform the function.The textbox is usually hidden until another function activates it to enter data.What I want to do is to bypass having the textbox come up and execute the function with predefined data. Basically the function refers to the data it gets as txtWrapupComment.value whereas txtWrapupComment is the textbox it's getting its data from.

So, the bottom line, is there a way I can declare txtWrapupComment.value and pass it before I execute the funtion?

View 9 Replies

VS 2008 Passing Values?

May 22, 2009

basically, i get "Object reference not set to an instance of an object" on the line:

example Dim x As Integer = objPlayer.Hand.Count

this line is in the object Dealer, but as far as i can tell i've declared everything correctly ...

i was told that i had to pass the values to the object or something, but not how to do it

View 18 Replies

How To Use String Array For Passing Values

Oct 21, 2011

I have a simple query but I am just not able to get it right. Have a look at my sample code below:

Sub Function1
My Code Here
Function2(Year,Month)
End Sub
Sub Function2(Year,Month)
Dim Str as String()
for 1 to 30
Dim MyDate As New Date(Year, Month, i)
Str = MyDate.DayOfWeek.ToString()
Next
Return Str
End Sub

View 7 Replies

Passing Input Box Values To A Sql Database?

Feb 23, 2011

I have an input box that allows users to enter a date that when the user clicks "Ok" that it does two things, marks a field called "code" in my Exceptions SQL table as H and passes whatever date they have entered to that table as well.

View 1 Replies

Passing Values (integer) Between Forms?

May 1, 2012

My problem is that I have two forms, Form1 and Form2 ...on Form1 there is a TextBox called txtTotal (this contains the calculation of Ticket Prices, thus it's a numeric value) and on Form2 there is a TextBox called txtTotal2. All I want to do is get the same number that appears in txtTotal on Form1 to appear in txtTotal2 on Form2 .However whenever I try some of the help tips online such as using a declaring txtTotal as global or friend it dosn't work, and any other code iv tried attempts pass the textbox value as String which brings an error.

View 2 Replies

Passing Values Back From Threads

May 8, 2009

Can anyone give me the best method of passing back a value from a Thread?I have some procedures that I have set up as threads that I'm starting at the same time.My main function then waits until the threads are done and I'm needing to get back some values that the threads have created.Is there a better way to get these values back rather than just having them set a global variable with the returned value? Also, what is the proper way to wait for a thread to to be completed?I've just got a loop waiting for the Thread. Thread State property to not be in the Running state.So if there is a more proper way to wait for the thread to end I would be interested in knowing it.

View 7 Replies

Passing Values From A List In Classes?

May 5, 2011

Im having a hard time trying to pass the values from a list inside of a class. Im trying to display multiple lines of values from a list inside of a class. My "client" class stores multiple lines of values into a list(of class transaction), with the number value(num) counting each transaction that it adds to the list.

Code:
Public Class Client
Private m_tranlist As New List(Of transaction)[code]....

im trying to display each line that is stored in the list in a label, and im having major trouble. I know all of the results are added into the lists, but how do i call the list in my main form in order to display each line of all of the values? Would I have to look up an index or something?

View 1 Replies

Passing Values From A VB App To A Stored Procedure?

Jan 6, 2011

This may not be the place to ask this, if not, you can move this post to the SQL forum but I have an application that I'm building which pulls dates from a database. The start value is stored as payPeriodStart date and I add 7 days to get the end date. What I need to know is, is it possible to store those values and pass them to a Stored Procedure? Currently my stored procedures have "static" dates in them ie:

where dateadd (n, Timestamp, '12/31/1899') - ([LoggedIn]/1000)/60/1440+1 Between '10/3/2010' and '10/10/2010'

and I'd like those values to be

Between payPeriodStartDate and payPeriodEndDate.

View 5 Replies

Passing Values Into Event Handler?

Feb 3, 2010

How do you pass values using a basic event handler:
'...
dropDownItem= New ToolStripMenuItem("item1", Nothing, New EventHandler(AddressOf clickHandler(1)))
'...
Public Sub clickHandler(ByVal sender As Object, ByVal e As System.EventArgs)
'dim i as integer = e
end sub

View 2 Replies

Passing Values To A Stored Procedure

Jan 6, 2011

I have an application that I'm building which pulls dates from a database. The start value is stored as payPeriodStart date and I add 7 days to get the end date. What I need to know is, is it possible to store those values and pass them to a Stored Procedure? Currently my stored procedures have "static" dates in them ie:

[Code]...

View 2 Replies

Passing Values To A Stored Procedure?

Feb 28, 2009

I am struggling with trying to pass values to a stored procedure, I am creating new records on my table by the values are not passing to the table.Here is my persistance class.

Public Function createDMRIssue(ByVal ItemNumber As String, ByVal IssueStatus As String, _
ByVal ProblemDescription As String, ByVal p_AuditResults As String, _
ByVal DMRDate As String, ByVal p_IssueCategory As String, _
ByVal p_DMRInitiator As String, ByVal p_QtyUnacceptable As Integer, _
ByVal p_ProductType As String, ByVal p_OrderNumberm_dmrissue As String)
Me.Connection()

[Code]...

View 7 Replies

Use A String Array For Passing Values?

Jun 8, 2009

how to use a String Array for passing Values

View 3 Replies

VS 2008 Passing Values Between Threads?

Oct 26, 2009

I am trying to get into vb.net but having an issue getting a variable value from a class library in a different thread.

What I am trying to do is create my own Winsock type control for my own use. Once data arrives I try and pass it back to the main application so that I can read it and process it.

So far I cant get it working at all. I have tried the following

Raiseevent

I try passing the value as a variable in the raiseevent property. This triggers an error about the value being in a different thread, I always thought that it would create a new variable in the thread of the application it was raising an event in and copy the value.

Function

I have tried writing a function into the class that I call (much like how the winsock control works) so that the class can return the value to the main application.

aka
strData = Myclass.GetData

in the class it returns the value and clears it from its own local variable. This however means the value returns to the main application as nothing even if I step through and see it assigning a value.

View 12 Replies

Winforms - Passing Values Out Of Forms?

Sep 8, 2011

I have a very simple windows forms setup. Form1 has a progress bar and a button on it, when clicked the button opens Form2 which also has a button on it that launches Form3. On Form3 is a button which I want to use to raise an event back to Form1.To achieve this can I add an event handler on form1 that will listen for an event of the type raised in form3? Or do I have to pass references to form1 to form2 and then from form2 to form3?

View 1 Replies

Accessing Tabs Within A Form

Apr 5, 2010

I have two tabs on a form, and I would like to know how can I display the second one when a button is clicked? The name of my tab control is tabSurvey.

View 5 Replies







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