I may be stating the obvious here but
Dim RS1 as Recordset
18 Replies - 1939 Views - Last Post: 22 November 2010 - 08:55 AM
#17
Re: Drop Down List
Posted 20 November 2010 - 02:29 AM
Yes i have set rs1 as recordset in declaration part please would you modify this code to get a drop down list please please.
#18
Re: Drop Down List
Posted 20 November 2010 - 04:02 AM
naveed_786, on 18 November 2010 - 11:19 AM, said:
Now it looks like this but when i debug it on this line
and
on this line
it says reference of object variable is net set
If Not .BOF And .EOF Then
and
on this line
Do Until .EOF
it says reference of object variable is net set
Private Sub txtsname_KeyPress(KeyAscii As Integer)
Set rs1 = db.OpenRecordset("SELECT StudentName FROM Admission WHERE StudentName LIKE '" & txtsname & "%'")
With rs1
If Not .BOF And .EOF Then
.MoveFirst
Do Until .EOF
txtsname.Text = rs1.Fields!StudentName
Debug.Print
.MoveNext
Loop
End If
End With
End Sub
I don't know if I have much else to add, but try getting rid of the With statement, adding rs1 before each command and see if it works...no sense in over-complicating a code that doesn't work to begin with
#19
Re: Drop Down List
Posted 22 November 2010 - 08:55 AM
|
|

New Topic/Question
Reply





MultiQuote






|