Drop Down List

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 2704 Views - Last Post: 22 November 2010 - 08:55 AM Rate Topic: -----

#16 guyfromri  Icon User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 817
  • Joined: 16-September 09

Re: Drop Down List

Posted 19 November 2010 - 05:24 PM

I may be stating the obvious here but

Dim RS1 as Recordset
Was This Post Helpful? 0
  • +
  • -

#17 naveed_786  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 306
  • Joined: 13-October 09

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.
Was This Post Helpful? -3
  • +
  • -

#18 guyfromri  Icon User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 817
  • Joined: 16-September 09

Re: Drop Down List

Posted 20 November 2010 - 04:02 AM

View Postnaveed_786, on 18 November 2010 - 11:19 AM, said:

Now it looks like this but when i debug it on this line
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 :)
Was This Post Helpful? 0
  • +
  • -

#19 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10486
  • View blog
  • Posts: 38,852
  • Joined: 27-December 08

Re: Drop Down List

Posted 22 November 2010 - 08:55 AM

View Postnaveed_786, on 20 November 2010 - 05:29 AM, said:

Yes i have set rs1 as recordset in declaration part please would you modify this code to get a drop down list please please.

We are happy to help you with your good faith efforts, but we will not simply fix the code.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2