thegameoflife
Programmer
I'm trying to get Prov2 updated by using the code below.
I need the code to take the value from prov# and and append/update Prov2. I'm STUCK
I need the code to take the value from prov# and and append/update Prov2. I'm STUCK
Code:
Dim a As String
Dim b As Integer
Dim c
Dim str2 As String
Dim rsmytable As Recordset
Dim I
Set rsmytable = New ADODB.Recordset
Dim sqll As String
For I = 1 To 51
rsmytable.ActiveConnection = CurrentProject.Connection
rsmytable.Open "ab", , adOpenKeyset, adLockOptimistic, _
adCmdTable
a = rsmytable.Fields("PROV #")
c = rsmytable.Fields("Prov2")
For b = 1 To Len(a)
str2 = str2 + Chr(Asc(Mid(a, b, 1)) + Asc("A"))
Next b
sqll = "INSERT INTO ab([Prov2]) VALUES (" & str2 & ");"
DoCmd.RunSQL sqll
'
rsmytable.MoveNext
rsmytable.Close
Next I