Adding A Number To The Result?
Oct 26, 2009
i need to add the number in textbox 1 to textbox2 and mutiply the result times .10, if the result is grater than or equal to 2000 i need to add 12 other wise i need to add 10 heres my code
Dim total double
total = Val(txtbox1.Text) + Val(txtbox2.Text) * 0.10
If total >= 2000 Then
[Code]....
View 2 Replies
ADVERTISEMENT
Jan 3, 2010
I'm trying to get the row number of the result row but I don't know the exact syntax.
For x = 0 To BDataGrid.RowCount - 1 'sort thru datagridview
If BDataGrid.Rows(x).Cells(0).Value = newID Then 'if result found
'get row number of result row???
End If
Next
View 3 Replies
Oct 14, 2011
adding all the numbers in a list box then multiplying it by a %.theres one listbox and two buttons, and two textboxes.i've completed everything but this and can't fibd it in my book. I just looking for pointers. this is what i have which i know isn't right
Dim sum, cost As Double
sum =
cost = sum * 0.06
lstbox.Items.Clear()
lstbox.Items.Add("Total Commission =" & cost & ".")
View 4 Replies
Nov 12, 2009
I am trying to add 2 variables and the result to appear in a label.The case is that there is a platinum version of an album which costs more. The extra cost depends on the album so it varies.If the user wants to purchase an ordinary and a platinum album then I must add the two variables and the combined price to appear in a label. The normal and platinum prices appear fine when the other is zero but when I increase the quantity on both the label remains blank.I have an if statement like this:
If PriceNormal >0 and PricePlatinum = 0 Then
lblPrice.text = PriceNormal.ToString("C")
End If[code]......
View 11 Replies
Apr 2, 2009
correct syntax to format decimals. I want 2 decimal places even if the result is an even number i.e. I want 40 to show as 40.00 and 40.6666667 to show as 40.67.
View 8 Replies
Mar 11, 2010
i have a division of 2 integer that give me a result as2,3944534 ...how i can give e result as
View 3 Replies
Jun 12, 2011
I'm having a problem with part of my application I'm trying to get the directory entry for a computer object in AD (it could be mutiple computer objects based on whether or not the users passes a wild card for the object name). These names would be added add a child node of the parent node "Computers" in the tree view. I'm just having problems with using the search results...
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim parentCNNode As TreeNode = New TreeNode("cn")
TreeView1.Nodes.Add("Computers")
[code].....
View 3 Replies
Feb 3, 2011
VS 2010 Adding whole numbers between a number and a number
View 3 Replies
Aug 14, 2009
I have the following code:
FormatNumber(.Item("Class_RAmt").ToString(), 2)
It able to convert the string to number, but the result is 1,200.00. How can I remove the comma within the number for example, 1200.00 instead of 1,200.00.
View 1 Replies
Sep 22, 2009
When logging into my system, I select the number of result that needs to appear on the report. In my stored procedure it selects count of all the data for a period. It returns all in the information, but I only want the number of records to appear on the report that I selected at the beginning.
View 1 Replies
Mar 26, 2011
i need some help here, i want a result that shown a total number from student who passed some subjects. Let say there are 8 student who got A in subject chemistry, then the output should display result something like " there are 8 students who got A in chemistry". And also is it possible to combined the result, for example i want the output something like "there are "X" students who got A in chemistry and physics". where "X" is variable (number). it should trigger when winform is loaded. im using bindingsource.filter, but failed. because using bindingsource.filter need the input from user then it produce the output. whereas i want the result shown when the winform is loaded. How can i achieve this.
View 4 Replies
Jul 30, 2009
I'm trying to do this division and the result to be displayed on a eight decimal number.
Dim r1 As Integer
Dim r2 As Double
r1 = Val(TextBox16.Text)
r2 = r1 / 60
TextBox18.Text = FormatNumber(r2, 8)
The value or R1 on this case is 273.4 but it varies according with the result obtained so I can not allocate a constant number to r1. The problem is the result that I am getting is 4,55000000 instead of 4.5566666
View 2 Replies
Mar 22, 2011
I have set up text boxes for user to pick a number 1-20 and to enter a word as well. Then, press submit button. What's supposed to display in result textbox is the word that many number of times. For example if the number is 5 and the word is hello, then "hellohellohellohellohello" should appear. I don't know how to complete my For...Next function to append the word to the result.
Public Class Ch6ex1
Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
[CODE].....................
View 5 Replies
Apr 22, 2009
I am working in excel trying to setup a function involving multiplying a cell by a set number and then having the result round to the nearest 10. Here's the beginning of my function statement fx=e3*1.026. say the result is 8654, I need it to round to 8650. Also if it comes back 8655, I need it to round to 8660. I have about 2,000 records I need to do this to so I was hoping that one formula or statement could be used for all my data.
View 2 Replies
Oct 8, 2011
Using VB.NetWhen i add a the number with zeros means, it is showing exact result without zero'sFor Example
Dim a, b, c as int32
a = 001
b = 5
[code].....
View 2 Replies
Oct 27, 2009
I have list of number to add, the fomate of how the number are listed a bit tricky. thats what I mean:
[Code]....
View 3 Replies
May 3, 2010
I have written a function that gets the alexa ranking of a given url, now this function works perfectly but I want to loop through a ListView of urls and grab the alexa rank of each item (url) with my function.The code works great if I put a MessageBox in the loop to test that the function is returning a value but when I remove the MessageBox the loop does not work.I need it to loop through adding each result without a MessageBox stop in each loop.
vb
For Each Item In ListView1.Items
Dim result As Integer
result = GetAlexaRank(Item.Text)
[code].....
View 12 Replies
Nov 14, 2010
I am using vb.net in a project and in one of my forms i added a datagridview(i am using Access database bytheway). In this datagridview i have 3 columns from the same data table(name, surname,telephone). My question is : "How can i give the telephone number in telephone(textbox) cell and view as result the name and surname in each of the cells? "
View 6 Replies
Jan 4, 2011
This sounds like the stupidest question ever!!! BUT what is the code for adding a number to a label with the label's value being calculated dependent on user input?! So you choose 2 numbers to multiply, If a box is ticked then you add 10 to the label. I've got everything else I just can't work out the structure/code for this little bit.
View 1 Replies
Aug 15, 2011
I have a fixed percentage 0.3% I need to multiply this by a number of months which varies 1 to 12
Having done this I need to add the percentage to a pre-determined number
so as an example
£300 + (0.3 * 10)
I can get the 3% (0.3 * 10)
But when I add this to the existing number (£300) it equals £303 not £309 which is what it should equal.
Can anyone advise the way of adding a percentage as appose to just another number? This also need to allow for -percentages i.e. -3%
The equation I am using is below and I appreciate there is nothing to set decTotalPercentage as an actual percentage but that's because I am stumped...
decTotalPercentage = decPercentage * intMonths
decFinalPercentage = decMoney + decTotalPercentage
View 4 Replies
Mar 16, 2010
I have a dataset that is being populated from a text file.
OrderNumber,Name,Model,Cost
123,john doe,product1,20.99
123,john doe,product2,10.75
There can be multiple of the same order number. In the dataset, I want to have a column "line number" and I want to put in it the value of the linenumber (in this case 1 and 2) per order. In sql , I was able to accomplish this by inserting rownumber() and grouping by order number. Can this be done in .net?
View 1 Replies
Dec 10, 2010
RichTextBox1.Text = RichTextBox1.Text + MaskedTextBox1.Text Everytime I click add, it just adds the actual number to the RTB1 instead of adding the numbers together like a calculator.
View 7 Replies
Dec 6, 2011
Im learning .net from vb6 and been stuck with this a while
Option Explicit Private Sub Command1_Click() Dim i As Long
For i = 1 To 3 Me.Controls("Text" & CStr(i)).Text = "This is textbox number: " & CStr(i) Next End Sub
View 4 Replies
Jun 2, 2011
EDIT: I am so sorry! I have added my thread to the C# discussion thread instinctively wherein in fact I have been creating my application in VB.NET so sorry! Please transfer my thread to the appropriate location! I am currently trying to mess around with a simple mp3 player and am in the process of creating a shuffle list from all the songs in my playlist.
View 2 Replies
Dec 9, 2009
I am fairly new to programming and I am completing the Step by Step by Microsoft for Visual Basic 2008, but I am not finding anything in the book about binding keystrokes for a program. I want to add the Number Pad into my Calculator Program so that every keystroke on it would correspond to a button in my program but I am unsure how to do this take.
View 1 Replies
Jul 17, 2011
I have an Access table which has an auto-number primary key. When I add a new record to it I want to be able to get the value of this field.
The relevant code I have is:
dsNewRow.Item("FullName") = NewStudentFields(0)
dsNewRow.Item("FirstName") = NewStudentFields(1)
dsNewRow.Item("LastName") = NewStudentFields(2)
[Code]....
I want to be able to access the value of the primary key immediately after the Update (if that's possible without having to search the dataset for the new record - cumbersome!) or, even better, just before the Update, if that's possible.
View 28 Replies
Feb 24, 2011
But task to use vb.net for school project. I want a code to help me add a No fo Months(this is an integer) to a datefield to do calcualtion and the result display in a textbox as a date. eg I have 2 fields: Months and startdate, the third field which is the result in a date format. eg 6 months to make a payments, the payment start from 01-02-2011. i want small code which would determine the enddate of the payment period. am getting a problem putting the code together
View 3 Replies
May 29, 2009
i am trying to count up to a number and add each number to a combo box. so for instance, the string value = 7. i want the combobox to count up to 7 in single numbers starting with 1
View 15 Replies
Dec 10, 2010
I am currently having a headache on how to solve this problem that i am facing. here is the situation: I have a combobox and a list box on the main form. The combobox will get the data from the ms access database. In the database, i have the details of a person's IC, Name and DOB say for eg on one entry I have D215311523C,SHAWN,13/04/1987 So now, my combobox on form load will show the list of dates in the database to allow the user to search base on the date itself by clicking on the selected date. So when the user clicks on the particular date say 13/04/1987, people in the database whose birthday is 13/04/1987 will be shown on the listbox.Meaning to say if i have 3 entries whose dates are the same 13/04/1987, 3 entries will appear. If there is only two entry, then two results will be shown. But now, when i do a single click on the date, one result will be shown. That is correct. But the problem is when i click on the same date again, three of the same results will be shown on the list box. that is it will display : 13/04/1987 13/04/1987 13/04/1987 which is not the case. Then it will show more duplicates of the same results if i click more times on the same date which should not be the case.
Dim n As Integer
Dim numbers() As Integer
Dim StartFrom As Integer
Dim EndAt As Integer
[code].....
View 3 Replies
Sep 25, 2010
I am using a datagrid in my where i am having four columns. In first column the parameter values are entered and in the second column measured value is entered and in third column the nominal value is entered.Inthe fourth column the result is displayed by subtracting the measured value and nominal values. I am doing this calculation in Datagrid cell validated event. What i want is,there will be many rows in the grid,when typing the value in the third column the corresponding result will be displayedin the rowof theresult column,save button will be displayed while the form loads,when the calculate part is completed that is there should not any cell of the resut column empty then i should enable the save butto.
View 2 Replies