|
-
Dec 21st, 2000, 03:21 PM
#1
Thread Starter
Member
hi serge.
i know there is a small error it is howing no current record.
help me what to do?
empname and empid.
priya 1
priya 2
reya 4
ani 8
priya 2
form2 contains textbox and listbox.
if i entered priya in the textbox,corresponding empid should be listed in the listbox.
say
1
2
2
if reya means
4.
i tried below it is showing no current record?
Private Sub cmd_list_Click()
Dim E As String
Dim I As Integer
Set WS = DBEngine.Workspaces(0)
Set DB = WS.OpenDatabase("C:\WINDOWS\PATS.MDB")
Set RS = DB.OpenRecordset("EMP", dbOpenDynaset)
E = "select empid FROM EMP WHERE ENAME='" & Text1.Text & "'"
Set rsl = DB.OpenRecordset(E, dbOpenDynaset)
rsl.MoveLast
I = rsl.RecordCount
If I > 1 Then
rsl.MoveFirst
Do While Not rsl.EOF
List1.List(j) = rsl.Fields("EMPID").Value
rsl.MoveNext
Loop
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|