see my code below.
Private Sub btnAddToReport_Click()
Call connectdb
Dim query0, query, query1, query2, query3, query4, query5, query6, query7, query8 As String
If MsgBox("Are you sure you want this to be added to report?", vbInformation + vbYesNo, "Report") = vbYes Then
query0 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('', ' ', '', '' )"
query0 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('', ' ', '', '' )"
query1 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('Flat bar(1pc/10 ft)', '" & Me.txtQuantity1.Text & "', '" & Me.txtCostQuantity1.Text & "', '" & Me.txtCost1.Text & "' )"
query2 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('Nitric Acid(ml)','" & Me.txtQuantity2.Text & "', '" & Me.txtCostQuantity2.Text & "', '" & Me.txtCost2.Text & "' )"
query3 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('Hydrochloric Acid (ml)','" & Me.txtQuantity3.Text & "', '" & Me.txtCostQuantity3.Text & "', '" & Me.txtCost3.Text & "' )"
query4 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('Pure gold (g)','" & Me.txtQuantity4.Text & "', '" & Me.txtCostQuantity4.Text & "', '" & Me.txtCost4.Text & "' )"
query5 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('Nickel (g)','" & Me.txtQuantity5.Text & "', '" & Me.txtCostQuantity5.Text & "', '" & Me.txtCost5.Text & "' )"
query6 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('Silver cyanide (ml)','" & Me.txtQuantity6.Text & "', '" & Me.txtCostQuantity6.Text & "', '" & Me.txtCost6.Text & "' )"
query7 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('Sodium cyanide (ml)','" & Me.txtQuantity7.Text & "', '" & Me.txtCostQuantity7.Text & "', '" & Me.txtCost7.Text & "' )"
query8 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('Sosa (ml)','" & Me.txtQuantity8.Text & "', '" & Me.txtCostQuantity8.Text & "', '" & Me.txtCost8.Text & "' )"
db.Execute (query0)
db.Execute (query0)
db.Execute (query1)
db.Execute (query2)
db.Execute (query3)
db.Execute (query4)
db.Execute (query5)
db.Execute (query6)
db.Execute (query7)
db.Execute (query8)
db.Close
Me.AdodcReports.Refresh
End If
End Sub
notice
query0 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('', ' ', '', '' )"
query0 = "INSERT INTO Reports(RawMaterials, Quantity, CostQuantity, Cost) VALUES ('', ' ', '', '' )"
as you can see, i use the command insert into to make an empty row however aside from making an empty row i also want to merge those cells.

New Topic/Question
Reply




MultiQuote




|