I need to execute four queries and then if there is success must return true otherwise false.
The queries affect the database but the function returns false
Private Function save_to_data()
Dim success As Boolean = False
Dim conn As OleDbConnection = GetDbConnection()
Dim total_due As Decimal = sanitize(txt_total_due.Text)
Dim amount_paid As Decimal = sanitize(txt_due.Text)
Dim discount As Decimal = sanitize(txt_discount.Text)
Dim balance As Decimal = sanitize(txt_balance.Text)
Dim cmdfoods As New OleDbCommand("UPDATE foods SET status='billed' WHERE customer_id = " & lbl_id.Text & "", conn)
Dim cmdservices As New OleDbCommand("UPDATE services SET status = 'billed' WHERE customer_id = " & lbl_id.Text & "", conn)
Dim cmdreservations As New OleDbCommand("UPDATE reservations SET nights = 4 WHERE customerid = " & lbl_id.Text & "", conn)
Dim bill As New OleDbCommand("INSERT INTO bills(customer_id, accomendation, food, service, total_due, amount_paid, discount, balance, transaction_date) VALUES " & _
"(" & lbl_id.Text & ", " & accomendation_total & ", " & food_total & ", " & service_total & ", " & total_due & ", " & amount_paid & " " & _
", " & discount & ", " & balance & ", '" & Date.Now & "')", conn)
conn.Open()
If cmdfoods.ExecuteNonQuery And cmdservices.ExecuteNonQuery And cmdreservations.ExecuteNonQuery And bill.ExecuteNonQuery Then
success = True
Else
success = False
End If
conn.Close()
Return success
End Function