# Hard to understand WHY

Posted by Ta on February 04, 1999 at 13:15:03:

Following are my codes:

Dim qb as database
dim cs as recordset

Set qb = OpenDatabase("a:\access\businessdata.mdb")
Set cs = qb.OpenRecordset("SalesRecord")

cs.MoveLast
cs.MoveFirst
For i = 1 To cs.RecordCount - 1
List1.AddItem cs(i)
cs.MoveNext
Next i

If I put these codes in DBcombo, it will show error message "Item not found in this collection" . Problem is at List1.AddItem "cs(i)"

If I put these codes in commandbox or form, it will show error message
" user defined type not defined" Problem is at Dim "qb as database"

Please help me solve problem. Thanks

Follow Ups:

- Re: Hard to understand WHY AndyLin 14:01:23 2/04/99 (1)
  - Re: Hard to understand WHY Ta 05:24:02 2/05/99 (0)