#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    35
    Rep Power
    11

    Updating Database


    I have a form that has a datacombo box on it and I have it setup with a list from a different table then the rest of the form I have it working and populating. What I need is when I make my selection I need the column in the main table to be updated with this new selection. Also when I go to the next record I need that field to be blank or contain the selection that has already been made. So what I need is the selection to be put in the correct column and stay there unless it is changed. below is the code used to populate the datacombobox.

    Private Sub Populatecombobox1()


    'Dim rscb As New Recordset
    'On Error GoTo errorHandler
    'Set rscb = New Recordset
    'rscb.Open "Select TeamMember_ID,FName&' '&LName as UName from Team order by FName", conn, adOpenDynamic, adLockReadOnly

    If rscb.RecordCount > 0 Then

    With DataCombo1(0)
    .Text = rscb!FName
    Set .RowSource = rscb
    .DataMember = "Test"
    .DataField = "Analysis_Owner"
    .ListField = "FName"

    End With
    rscb.MoveFirst
    End If
    Set rscb = Nothing



    End Sub

    Thanks in advance for any help.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Melbourne, Australia
    Posts
    212
    Rep Power
    12
    One way is to open the original table, and then before you update a field, compare the original value with the value being submitted.

    If value submitted <> value original Then
    'update database cause the value has changed
    End if.

    HTH
    How can I soar like an eagle when
    I'm flying with turkey's?

IMN logo majestic logo threadwatch logo seochat tools logo