I would like to paste value from tblZlecenia.nowe_id to tblDocelowa.nowe_id (number fields) in every record where tblZlecenia.id_zlecenia = tblDocelowa.id_zlecenia (text fields). I found some code and remodeled it, so now my code look like this:
It doesn't works :/ Please guys, help me!
Code:
Private Sub Polecenie0_Click()
Dim strSQL As String
Dim recIn As Recordset
strSQL = "SELECT * FROM tblZlecenia"
Set recIn = CurrentDb.OpenRecordset(strSQL)
While Not recIn.EOF
strSQL = _
"UPDATE tblDocelowa " & _
"SET nowe_id = recIn!nowe_id " & _
"WHERE ID_Zlecenia ='" & recIn!id_zlecenia & "'"
CurrentDb.Execute strSQL, dbFailOnError
recIn.MoveNext
Wend
recIn.Close
End Sub
It doesn't works :/ Please guys, help me!