PDA

Click to See Complete Forum and Search --> : Update of Data control Recordset(DAO)


Gidget
Nov 3rd, 2000, 03:36 AM
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

paulw
Nov 3rd, 2000, 03:42 AM
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.

Gidget
Nov 3rd, 2000, 04:07 AM
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!!

AdrianH
Nov 3rd, 2000, 07:31 AM
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.

paulw
Nov 3rd, 2000, 07:37 AM
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.