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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time error6 Overflow 1

Status
Not open for further replies.

mikeba1

Programmer
Joined
Jan 2, 2005
Messages
235
Location
GB
Dim db As Database
Dim rst As Recordset
Dim strSQL As String
Dim frn
Dim ton
frn = Forms![frmSLRePrintInvoices]![FromInvNo]
ton = Forms![frmSLRePrintInvoices]![ToInvNo]
strSQL = "SELECT SLInvoices.SLIPrinted, SLInvoices.SLINumber "
strSQL = strSQL & " From SLInvoices "
strSQL = strSQL & " WHERE (((SLInvoices.SLIPrinted)=True) AND ((SLInvoices.SLINumber) Between " & frn & " And " & ton & "))"
strSQL = strSQL & " ORDER BY SlInvoices.SLInumber;"
Set db = CurrentDb()
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)

The above piece of code gives the following error.

Run time error 6

OVERFLOW

Any Ideas

Thanks
 
Try dimensioning the variables as the data type of the fields they represent - are they strings? or longs?
[tt]
Dim frn As Long
Dim ton As Long
[/tt]

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top