Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    2

    Unanswered: VBA to update a field in MS200 database

    hi need help...i have a current mdb stored on my win2002 server

    i have a scrip in excel vba which will update new data into the fields in the database.....but over a period of time some data may change and i need to update the database with the latest data from my excel sheet...

    example
    mdb field 1 = name
    mdb field 2 = salary

    i need to update the salary of the particular name only any one can help....

  2. #2
    Join Date
    Nov 2003
    Posts
    2
    Public Function ChangeField(rstTable As Recordset, intID As Integer, strFieldName As String, varValue As Variant)As Integer
    With rstTable
    .Requery
    .FindFirst "ID = " & intID
    If .NoMatch = True Then
    ChangeField = -1
    Else
    .Edit
    .Fields(strFieldName).Value = varValue
    .Update
    ChangeField = intID
    End If
    End With
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •