Click here to Skip to main content
15,921,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is th query in aceess
SQL
SELECT indents.pr_no, indents.issue_date, items.description, items.units, items.item_group, indentitems.quantity, indentitems.date_required, departments.system_name, departments.subsystem_name
FROM ((indentitems INNER JOIN indents ON indentitems.pr_no=indents.pr_no) INNER JOIN departments ON indentitems.department_code=departments.department_code) INNER JOIN items ON indentitems.item_code=items.item_code;

when i use the form wizard to make a form for this query the error box shows subscript out of range..
i dont understand what is happening
can anyone help please????
thanks in advance
Posted

1 solution

A subscript out of range error occurs when you are trying to move to a record which has an index about the upperbound of the collection.

e.g. if you have an array defined with 10 elements and you try to read element 11.

Without seeing code which is throwing the exception it is difficult to say the exact problem.

Suggest you step through your code until you find the line that throws the exception and then work out what you are doing with any index values.

A common error is forgetting that counts will be higher than index values and when iterating sets referencing the count, you need to subtract 1 from the upper limit.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900