AlvaroCity
Registered User.
- Local time
- Today, 21:22
- Joined
- Jul 16, 2016
- Messages
- 70
Hello there.
I am trying to create an UPDATE query on vba but I don't how to do it.
I have been watching lots of tutorial about how to do it but I am too noob.
I hope you could give me a hand.
I have this code so far. I hope it would help to spot what is wrong.
Thank you for your help.
I am trying to create an UPDATE query on vba but I don't how to do it.
I have been watching lots of tutorial about how to do it but I am too noob.
I hope you could give me a hand.
I have this code so far. I hope it would help to spot what is wrong.
Code:
Dim Ssql As String
Dim StrNumpiezas As String
Dim StrAlbaran As String
StrAlbaran = Me.AlbaranID
StrNumpiezas = Me!frmSubAlbaran.Form!txtNumeroPiezas
Ssql = "UPDATE tblPiezas INNER JOIN (tblPedidoDetalle INNER JOIN tblpedidodetallealbaran ON tblPedidoDetalle.[PedidoDetalleID] = tblpedidodetallealbaran.[PedidoDetalleID]) ON tblPiezas.[PiezaID] = tblPedidoDetalle.[PiezaID]" & _
"SET tblPiezas.Stock=" [Stock]-StrNumPiezas" & _
"WHERE (((tblpedidodetallealbaran.AlbaranID)=StrAlbaran));
Thank you for your help.
