I am doing the finding and editing process in adodb.
The result i am getting is not correct. The Msgbox is display the correct records. But as soon as it displays the first name in the textbox it is not correct. It is always displaying the last record of the database.
Here is my code: Plz help:
Private Sub cmdedit_Click()
Call connect
Call addmem
Dim n As Integer
rs.MoveFirst
n = Val(InputBox("E nter the member id to be searched"))
rs.Find "ID ='" & n & "'"
MsgBox ("Found" & rs("ID") & rs("First Name") & rs("Last Name"))
frmaddmem.txtid .Text = rs.Fields("ID")
frmaddmem.txtfi rstname.Text = rs.Fields("Firs t Name")
frmaddmem.txtla stname.Text = rs.Fields("Last Name")
frmaddmem.Show
End Sub
The result i am getting is not correct. The Msgbox is display the correct records. But as soon as it displays the first name in the textbox it is not correct. It is always displaying the last record of the database.
Here is my code: Plz help:
Private Sub cmdedit_Click()
Call connect
Call addmem
Dim n As Integer
rs.MoveFirst
n = Val(InputBox("E nter the member id to be searched"))
rs.Find "ID ='" & n & "'"
MsgBox ("Found" & rs("ID") & rs("First Name") & rs("Last Name"))
frmaddmem.txtid .Text = rs.Fields("ID")
frmaddmem.txtfi rstname.Text = rs.Fields("Firs t Name")
frmaddmem.txtla stname.Text = rs.Fields("Last Name")
frmaddmem.Show
End Sub