I have a datagrid on my form I want to populate with data that is being calculated on my form, and after looking around for awhile I decided to post here. Please keep in mind I am very new to VB and I am just learning. Currently on my form I have Textboxes to display the data that I want added to my table just so I can see that everything is working as it should and it does now if I could just add the information to my table things would be better. If anyone could be so kind and give me a clue how I can add a record with the data that is contained in txtDesc, txtWebHrs, txtWebDollars and txtTotal it would be greatly appreciated. One more quick note how can I control how many decimal places are used for example I would like to round the Price field to only store 2 positions past the decimal.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim QTY As Integer = 0
Dim Pages As Integer = 0
Dim sig1qty As Integer = 0
Dim sig1val As Integer = 0
Dim sig2qty As Integer = 0
Dim sig2val As Integer = 0
Dim sig3qty As Integer = 0
Dim sig3val As Integer = 0
Dim WebHours As Decimal
Dim WebDollars As Decimal
Dim Description As String
Dim Price As Decimal
QTY =
Integer.Parse(txtQTY.Text)
Pages =
Integer.Parse(txtPages.Text)
sig1qty =
Integer.Parse(txtSig1Qty.Text)
sig1val =
Integer.Parse(txtSig1Val.Text)
Description =
"Web Press"
txtDesc.Text = Description
WebHours = sig1qty * QTY / 18000
txtWebHrs.Text = WebHours
WebDollars = 78.81
txtWebDollars.Text = WebDollars
Price = WebHours * WebDollars
TxtTotal.Text = Price
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'StrangDataSet.TestQuote' table. You can move, or remove it, as needed.
Me.TestQuoteTableAdapter.Fill(Me.StrangDataSet.TestQuote)
End Sub
End
Class