Error Number 6 - Overflow Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Invoicing Section of a Cards Database (Access 2003)
First Invoices cover 9 - 12 months data so they are big - in excess of 255
lines for some Invoices. Normally would be 10 - 60 The Generate and Print of
the Invoices is done on the click of a Command Button. The VBA generates the
SQL to select the lines to invoice (ADODB Recordset), Updates all of the
lines with Invoice Number etc a works a treat until you hit an Invoice with
in excess of 255 lines when you get Error Number 6 Overflow, Any fast get
around? Any reason why the one byte 255 magic number. The system processes in
excess of 100,000 recs from CSV files ever night, updating and adding records
no problem and very fast too, but will only process 255 records for my
invoices!
Please don't tell me it's a feature of Access.
 
Access gives an overflow error when the data exceeds the capacity of the
field size. You probably either have a variable in VBA defined as a byte
that is counting the invoice line, or a field in the resulting query that is
calculating the invoice line and is dimensioned as a byte (Access
automatically sets the sizes of calculated fields based on the input values,
but I'm not sure if it ever uses byte).

Where in the process do you get the error? Are you familiar with VBA at
all? If you are, I would check the sizes of the VBA variables. If those all
look OK, you may want to modify the sql of the query to enclose the
calculated invoice line number inside of the CInt() or CLng() functions to
coerce the query into using that field size for the result.

If you aren't familiar with VBA, post back and I can tell you how to get to
the code to review it.

HTH, Ted Allen
 
Back
Top