Im just having a problem on my VB 5 update command..

Adodc1.RecordSource = "UPDATE Tuition_Fee SET (Amount_Paid, Balance) VALUES(" & WHERE Tuition_Fee_ID_PK = " & Form2.Label16.Caption
    'Adodc1.RecordSource = "UPDATE Tuition_Fee SET (Amount_Paid = " &  & ", Balance = " & Val(Text1.Text) - Val(Text2.Text) & ") WHERE Tuition_Fee_ID_PK = " & Form2.Label16.Caption

anyone? thanks

'where Tution_Fee = tablename
strSQL = "UPDATE Tution_Fee SET (Amount_Paid = [Tution_Fee].[Amount_Paid]+" & (Val(Text1.Text) - Val(Text2.Text)) & " WHERE Tuition_Fee_ID_PK = " & Form2.Label16.Caption

Good Luck

thanks vb5prgrmr

i solved it using this one :)

Adodc1.Refresh
    Adodc1.Recordset.Update
    Adodc1.Recordset.Fields("Balance") = Val(Text1.Text) - Val(Text2.Text)
     Adodc1.Recordset.Fields("Amount_Paid") = Val(Text2.Text) + Val(Text3.Text)
    Adodc1.Recordset.Update
    

    Adodc1.RecordSource = "SELECT * FROM Tuition_Fee WHERE Tuition_Fee_ID_PK = " & Form2.Label16.Caption
    Adodc1.Refresh
    Text4.Text = Adodc1.Recordset.Fields("Tuition_Fee")
    Text3.Text = Adodc1.Recordset.Fields("Amount_Paid")
    Text1.Text = Adodc1.Recordset.Fields("Balance")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.