i have the following code...
Sub Update_Line()
Dim strSQL As String
Dim rsSOBP As DAO.Recordset
Dim a As Integer
Set rsSOBP = CurrentDb.OpenRecordset("SELECT SOBP FROM Countries;")
Do While Not rsSOBP.EOF
a = a + 10
strSQL = "UPDATE " & rsSOBP!SOBP & " SET Line = " & a & ";"
CurrentDb.Execute strSQL
rsSOBP.MoveNext
Loop
rsSOBP.Close
Set rsSOBP = Nothing
End Sub
this is giving me numbering of all the lines in all the tables i have..
Tables 1
10
10
10
10
Table 2
20
20
20
20
i wants to have
Tables 1
10
20
30
40
Table 2
10
20
30
How can i change my code to make this work?
Please i ve been trying for days now to get this right...
Sub Update_Line()
Dim strSQL As String
Dim rsSOBP As DAO.Recordset
Dim a As Integer
Set rsSOBP = CurrentDb.OpenRecordset("SELECT SOBP FROM Countries;")
Do While Not rsSOBP.EOF
a = a + 10
strSQL = "UPDATE " & rsSOBP!SOBP & " SET Line = " & a & ";"
CurrentDb.Execute strSQL
rsSOBP.MoveNext
Loop
rsSOBP.Close
Set rsSOBP = Nothing
End Sub
this is giving me numbering of all the lines in all the tables i have..
Tables 1
10
10
10
10
Table 2
20
20
20
20
i wants to have
Tables 1
10
20
30
40
Table 2
10
20
30
How can i change my code to make this work?
Please i ve been trying for days now to get this right...