Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update or Append or what??

Status
Not open for further replies.

thegameoflife

Programmer
Dec 5, 2001
206
US
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

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
 
sqll = "INSERT INTO " & a & b & "([Prov2]) VALUES (" & str2 & ");"
DougP, MCP
 
sqll = "INSERT INTO " & a & " " & b & "([Prov2]) VALUES (" & str2 & ");"
DougP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top