|
-
Jun 20th, 2005, 10:46 AM
#1
Thread Starter
Addicted Member
Calling Subprocedure problem
I created a class module to place a section of code in. The code reads the database and fills in a combobox with the records returned. I call the sub procedure from my form code by "Call mySP.FillSpecialPrograms", but the code hangs when it gets to the cboSpecProgs.Clear line. I receive a Run-time Error '424' Object required.
Any suggestions??
Here is the code for the sub procedure.
Public Sub FillSpecialPrograms()
Dim rs As New ADODB.Recordset
rs.Open "select * from regtb_specialprog", gcnData
cboSpecProgs.Clear <------This is where the code hangs.
cboSpecProgs.AddItem ""
cboSpecProgs.AddItem "Gifted/Talented"
cboSpecProgs.ItemData(cboSpecProgs.NewIndex) = -1
Do While Not rs.EOF
cboSpecProgs.AddItem rs("description")
cboSpecProgs.ItemData(cboSpecProgs.NewIndex) = rs("code")
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Sub
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
|