Dear Friend
I have a table named as “ient†and I can save data over there or retrieve data from there. Now I want to display data in the control boxes like textbox, combo box, date picker etc. one after another i.e. by clicking on the command button move next/move previous etc and I have used below code for move next, but it’s not working. Please help on this issue.
Dim rst1 As New ADODB.Recordset ‘ in the general declaration
Private Sub cmdnext_Click()
DBconnect ‘I have used this public sub-routine to connect with the database
If rst1.State = adStateOpen Then rst1.Close
rst1.Open "ient", cnt, adOpenDynamic, adLockOptimistic
If Not rst1.EOF() And Not rst1.BOF() Then rst1.MoveNext
With rst1
txtrefno.Text = .Fields(0)
Combo1.Text = .Fields(1)
DTPicker1.Value = .Fields(2)
cmbcustomer.Text = .Fields(3)
cmbmanufacturer.Text = .Fields(4)
txtinvoice.Text = .Fields(5)
DTPicker2.Value = .Fields(6)
End With
End Sub
Appreciate, if you would come back soon.
Regards
Pervez
Tags: