I have two functions. The first function fills the first three fields of the first row of an MS_Access table. I want to fill the remaining fields of the same(1st) row in the second function. Presently the second function fills the remaining fields of the next(2nd) row while the remaining fields of the first row remain unfilled.
Also the first three fields of the 2nd row remain unfilled.
Declare the Recordset in Form Level.
Open the Recordset In First Function
(Or Before calling first function)
Add required fields in first function. Dont close the recordset.
Now call Second Function, here Dont open the recordset again..
something like this :
Dim MyRS As New ADODB.Recordset
Private Sub Myproc1()
MyRS.Open "Select * From MyTab",Conn, adOpenDynamic, adLockOptimistic
MyRS("Fl1") = Text1.Text
MyRS("Fl2") = Text2.Text
MyRS("Fl3") = Text3.Text
Private Sub Myproc2()
MyRS("Fl4") = Text4.Text
MyRS("Fl5") = Text5.Text
MyRS("Fl6") = Text6.Text
Thanks for your suggestions. I tried the above given solutions but still I am unable to rectify the problem.
Please find attached the snap shot of the database. The first three fields in the first row are being populated in the first function. The second function is called multiple times, and each time one field should be updated in the same (1st) row.
Presently, when the second function is getting called, the field is updated in the next row as shown in the attachment.