• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

need help to fill a field in the access table one bye one

jagu143

New Member
hi,

I need to update data in a field of a access table one by one. or 70% of the table filds I need to fill with one value.

below code update entire table. please help. thank you!

Code:
dimsa = "Tbl_Production"
  strAreaType2 = Form_Assign.txt_activity.Value
  cntid = Form_Assign.Combo237.Value
  strSQLCheckUserExists = "Select  * FROM " & dimsa & " where Activity_Name ='" & strAreaType2 & "' and Processor='" & cntid & "'"
  Recsetwatt.Open strSQLCheckUserExists, conwatt, adOpenDynamic, adLockOptimistic

  s = Form_Assign.Text242.Value
  w = Form_Assign.Text95.Value

  pvalue = s * 70
  pvaluep = pvalue / 100
  i = 0

  For i = 1 To pvaluep

  With Recsetwatt

  conwatt.Execute "Update " & dimsa & " set Userid_s= '" & Form_Assign.Combo234.Value & "' where Activity_Name ='" & strAreaType2 & "' and Processor='" & cntid & "'"
  End With
  i = i + 1

  Next

regards,
jagu
 
Last edited by a moderator:
Back
Top