If bStudentNumberExists Then
Using cmd As OleDbCommand = New OleDbCommand
sSaveSql = "update CUSTOMER set " _
& "Surname = ?," _
& "Given = ?," _
& "DateOfBirth = ?, " _
& "Sex = ?," _
& "Phone = ?," _
& "Address = ?," _
& "Suburb = ?," _
& "State = ?," _
& "PostCode = ?," _
& "where ID = ?;"
cmd.Parameters.AddWithValue("@Surname", oThisFormA.txtCusSurname.Text.Trim)
cmd.Parameters.AddWithValue("@Given", oThisFormA.txtCustGiven.Text.Trim)
cmd.Parameters.AddWithValue("@DateOfBirth", CDate(oThisFormA.txtCustDOB.Text.Trim))
cmd.Parameters.AddWithValue("@Sex", oThisFormA.txtCustSex.Text.Trim)
cmd.Parameters.AddWithValue("@Phone", oThisFormA.txtCustPhone.Text.Trim)
cmd.Parameters.AddWithValue("@Address", oThisFormA.txtCustAddress.Text.Trim)
cmd.Parameters.AddWithValue("@Suburb", oThisFormA.txtCustSuburb.Text.Trim)
cmd.Parameters.AddWithValue("@State", oThisFormA.txtCustState.Text.Trim)
cmd.Parameters.AddWithValue("@PostCode", oThisFormA.txtCustPostCode.Text.Trim)
cmd.Parameters.AddWithValue("@ID", CInt(oThisFormA.txtCustID.Text.Trim))
End Using
'sSaveSql = "update CUSTOMER set " _
' & "Surname = '" & oThisFormA.txtCusSurname.Text.Trim & "'," _
' & "Given = '" & oThisFormA.txtCustGiven.Text.Trim & "'," _
' & "DateOfBirth = '" & oThisFormA.txtCustDOB.Text.Trim & "', " _
' & "Sex = '" & oThisFormA.txtCustSex.Text.Trim & "'," _
' & "Phone = '" & oThisFormA.txtCustPhone.Text.Trim & "'," _
' & "Address = '" & oThisFormA.txtCustAddress.Text.Trim & "'," _
' & "Suburb = '" & oThisFormA.txtCustSuburb.Text.Trim & "'," _
' & "State = '" & oThisFormA.txtCustState.Text.Trim & "'," _
' & "PostCode = '" & oThisFormA.txtCustPostCode.Text.Trim & "'," _
' & "where ID ='" & oThisFormA.txtCustID.Text.Trim & "';"
Else
sSaveSql = "insert into CUSTOMER(ID, Surname, Given, DateOfBirth,Sex,Phone,Address,Suburb,State,PostCode) " _
& " values('" & oThisFormA.txtCustID.Text & "'," _
& "'" & oThisFormA.txtCusSurname.Text.Trim & "'," _
& "'" & oThisFormA.txtCustGiven.Text.Trim & "'," _
& "'" & oThisFormA.txtCustDOB.Text.Trim & "'," _
& "'" & oThisFormA.txtCustSex.Text.Trim & "'," _
& "'" & oThisFormA.txtCustPhone.Text.Trim & "'," _
& "'" & oThisFormA.txtCustAddress.Text.Trim & "'," _
& "'" & oThisFormA.txtCustSuburb.Text.Trim & "'," _
& "'" & oThisFormA.txtCustState.Text.Trim & "'," _
& "'" & oThisFormA.txtCustPostCode.Text.Trim & "' )"
MsgBox("ID:" & sCusID & " has been Added to the table")
' Be careful however with the commas and the closing bracket
End If