Click to See Complete Forum and Search --> : Urgent - Updating a Recordset


HanneSThEGreaT
August 30th, 2001, 09:53 AM
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.

Spectre5000
August 30th, 2001, 03:18 PM
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.

HanneSThEGreaT
August 30th, 2001, 06:07 PM
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.

Cimperiali
August 31st, 2001, 06:59 AM
>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

Spectre5000
August 31st, 2001, 07:56 AM
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!

HanneSThEGreaT
September 1st, 2001, 02:52 PM
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.