I am working on a multi-form project right now for shipping and receiving inventory.
I am working on my new orders section and this section contains
order number txt box
employee txt box
vendor combo box
part number combo box
model number combo box
quantity combo box
add item button
save order button
The idea is that when you enter data in the fields, you can hit the add item button. The following actions will happen:
text in vendor combobox will be added as a dropdown selection
text in part number combobox will be added as a dropdown selection
text in model number combobox will be added as a dropdown selection
[part number can be associated with multiple model numbers but not vise versa
when an existing part number is chosen, the model numbers are narrowed down to being able to add a new model number or choose from a model number previously associated with part number chosen]
DataGridView displays part number, model number and quantity
part number, model number, quantity are then cleared allowing you to re-enter those 3 fields, already associated with the order number, employee, vendor, then appear in a new line on the datagridview until the order is assembled each different part number at a time
Hitting the save order button:
saves a line of data with all 6 fields entered, one line for each part number, and records the date item was saved, all recorded into a database.
Note: Should not record to database until save order is pressed.
So far I have
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click 'Create Data connection 'Declare variables to connect to string Dim fldr As String Dim con As New OleDb.OleDbConnection Dim dbProvider As String Dim dbSource As String fldr = Application.StartupPath() dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;" dbSource = "Data Source=" & fldr & "\SRC.mdb" con.ConnectionString = dbProvider & dbSource 'Create database adapter Dim daNew As New OleDb.OleDbDataAdapter("select * from On_Order", con) 'Create a data set Dim dsNew As New DataSet 'Set select command daNew.SelectCommand.CommandText = "Select * From On_Order" 'Update Commands Dim cbNew As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(daNew) 'Fill dataset daNew.Fill(dsNew, "On_Order") 'Create new row Dim rowInsert As DataRow = dsNew.Tables("On_Order").NewRow 'Add data to the row from text rowInsert("Order_Number") = txtOrder_Number.Text rowInsert("Vendor") = cmb_Vendor.Text rowInsert("Employee") = txtEmployee.Text rowInsert("Part_Number") = cmbPart_Number.Text rowInsert("Model_Number") = cmbModel_Number.Text rowInsert("Qty") = txtQty.Text 'Add row to data set dsNew.Tables("On_Order").Rows.Add(rowInsert) End Sub
I have been working on it for a few days now and cant seem to figure out how to display specific information in the dgv. (sorry, I already deleted the code that didnt work to display to dgv)
I like to make detailed comments so I know what is suppose to do what, again, I am learning
Seems like alot, and this is only 1/3 of the first form, but if i can get alot of that done, im sure ill have learned enough to get me close to being able to finishing the rest.
Anyway, If I could get help tackling a little bit here and there, I could definately see myself learning this and being able to press on. I appreciate any assistance and advice. I know its always nice to have others look at things because there always is multiple ways to do the same task.