Results 1 to 5 of 5

Thread: Update of Data control Recordset(DAO)

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Location
    Johannesburg, South Africa
    Posts
    2
    Someone please help!!!

    See code below

    Data4.Recordset.Edit

    Data4.Recordset("rate of pay1") = Val(txtrop1)
    Data4.Recordset("rate of pay2") = Val(txtrop2)
    Data4.Recordset("max pay") = Val(txtmaxpay)

    Data4.Recordset.Update
    the update doesn't seem to be working, when I display
    Data4.Recordset("rate of pay1") after the update I get the old value.
    NB when the update line executes the program goes to
    Private Sub data4_Reposition(), I put the Debug.print statement with Data4.Recordset("rate of pay1"), in the beginning of this sub and here it is already showing the old value.

    What am I doing wrong, or where should I do the update

    Thanks in advance guys

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    If the values are in the text boxes on the same form, why not bind them directly? If on a different form then qualify the controls e.g. Val(frmOtherForm.txtrop1)

    It may be that the value is not visible. Give me a few more details - what you are attempting, how the forms interact etc and I will try and help.

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Location
    Johannesburg, South Africa
    Posts
    2
    The textboxes are on the same form and the values in the textboxes are user input and validated before the Update takes place. If thats of any help.

    nb Just before the update the value that is moved to
    Data4.Recordset("rate of pay1") is still there but after the update command executes the old value is in Data4.Recordset("rate of pay1") Strange!!

  4. #4
    Lively Member
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    82
    Whenever I use the Data Control, after an Update, I always use the Refresh method, seems to work OK for me.

    Data1.Edit
    .
    .
    Data1.Update
    Data1.Refresh

    Cheers
    Adrian.

  5. #5
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    Are you sure your recordset is updatable? The edit mode will post changes but the update will attempt to finalise those, if the recordset is not updatable it will not work. It also may be that one or two of the fields are not updatable.

    Without more details (i.e. environment, connection details etc.) I can't tell.

    Cheers,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

Posting Permissions

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



Click Here to Expand Forum to Full Width