Invalid operation. (Error 3219)

thechazm

VBA, VB.net, C#, Java
Local time
Today, 10:49
Joined
Mar 7, 2011
Messages
515
For some reason this function just decided to stop working even though its been working just fine the last 500 records or so.

Code:
rsATMSQuals.FindFirst "(([Personal Number]) = " & stblAutoNumber(i) & ") AND (([Qual Number]) = """ & AtmsQualsNumber & """)"

This is the debug of the values:

(([Personal Number]) = 6113) AND (([Qual Number]) = "BASFIRE_WATCH")

I cannot find any reason why this would happen. Can someone please shed some light please.

Thanks,

TheChazm
 
*Just stopped working* doesn't tell us much... Is there a line that highlights? What does the whole section of code do? If it's looping have you looked at the records?

Also, can you post the entire section of code it might help to shed some light on the issue.
 
Thanks for the reply but with over 2000 lines of code in it I don't think it would be a good idea to post it all.

I actually figured it out and what it was is I was setting a reference to the dao.recordset more than once during a loop. After removing that and putting it outside the loop it works fine.

Thanks,

TheChazm
 
Hehe... okay yeah, 2000+ lines, I don't have my reading glasses on! Glad you found it and thnks for posting the solution it's bound to help someone else!
 
Do you have that many lines in one procedure? If so, it should be broken up into pieces to make it more maintainable. If not, then I misunderstood and - "never mind..." :D
 
boblarson Thanks for the backup. Yes it is actually split into multiple procedures but even with that the main function is 2000 lines plus. I will someday after many hours and severial gallons of coffee get it to a much smaller size. Total lines for all the procedures that it uses plus itsself is around 3400 lines. :/
 

Users who are viewing this thread

Back
Top Bottom