CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Urgent - Updating a Recordset

    Hi all you gurus!
    I've got a problem again...
    My problem is that I've got to text boxes which are connected to a recordset. One displays the price and the other one displays the installment I've added a variable to it. What I want to do is if I type something in the Installment textbox, it must automatically deduct the info entered from the the Price, and then update the recordset immediately, so that all the other forms show the "new" price.
    How can I do this¿
    Please email me if this problem is unclear.
    Please help, it's very Urgent!
    Thanx.

    F. T. W.

  2. #2
    Join Date
    Apr 2001
    Location
    Wisconsin, USA
    Posts
    150

    Re: Urgent - Updating a Recordset

    I am not sure what your form looks like, but try this:


    ' here you set up your connection, and recordset
    private sub text1_lostfocus()
    dim curPrice as currency
    dim curInstall as currency

    curInstall = text1.text
    curPrice = text2.text
    text2.text = curPrice - curInstall

    rs1.update
    end sub




    This is a simple way to do it, but you may need to adjust to handle other things that your program
    is doing that you didn't specify were taking place. This will take place, obviously, after you type
    in the installment amount and then either click or tab away from the installment text box.


  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Urgent - Updating a Recordset

    Hi! I've taken your advice, it worked - well sort of. I can see the value changing, but I now get the following error message:
    "Provider called a method from IRowsetNotify in the consumer and the method has not yet returned"
    How can I fix this¿

    F. T. W.

  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Urgent - Updating a Recordset

    >connected to a recordset
    You should update the recordset, then refresh the recordset. If textboxes are bounded to recordset, they should show the stored data.

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  5. #5
    Join Date
    Apr 2001
    Location
    Wisconsin, USA
    Posts
    150

    Re: Urgent - Updating a Recordset

    This is one that I am unsure of. This is an error that I have not seen before, so I cannot tell you
    how to fix it. Sorry!


  6. #6
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Urgent - Updating a Recordset

    Thanx anyway. I checked out MSDN, they said that Microsoft is still unsure about this error message. But, I've included rs1.move 0 before rs1.update, I saw it in an example - so now it's fixed. Seems like everytime I think I'm getting somewhere I seem to get stuck again.

    Thanx anyways for your help

    F. T. W.

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

Featured