Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overflow Error '6'

Status
Not open for further replies.

MTBChik

Technical User
Jun 19, 2001
58
0
0
US
I have a form that has a list box that displays items based on it's id in the database. It has been working for several years, but today, decided to give me this error. I am over 45000 id's. (Just added a ton of new products.) Could this be the problem?

Here's where it's balking

With rs
.Open sql, cn, adOpenForwardOnly, adLockReadOnly
Do While Not rs.EOF
'add the item to the list
lstArray.AddItem rs("last") & ", " & rs("first")

'get the unique id from the db and assign it to the item for the list
(CHOKES HERE!!) intID = rs("id")
Me.lstArray.ItemData(Me.lstArray.NewIndex) = intID

'Move to the next record
rs.MoveNext
intCounter = intCounter + 1

Loop

__~o
`\<,
(_)/(_)
MTBChick
The day you stop riding is the day you die.
 
Look for a line that is...
Dim intID as Integer

And change to

Dim intID as Long

This should fix your problem. Then, while you are at it, change the other Integers to Longs too.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Dang! That was too easy (and Fast)

Thanks so much!

C

__~o
`\<,
(_)/(_)
MTBChick
The day you stop riding is the day you die.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top