View Single Post
Old Mar 14th, 2005, 1:55 PM   #4
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Actually, a type mismatch can occur for one of two reasons. Firstly, you're trying to do something impossible that VB can't do, such as set an Object equal to a Long. Secondly, you're trying to do something such as set a string equal to a number, which under strict typecasting (option explicit on) will raise an error. By turning it off, and seeing if the error occurs again, you can decide which of the two circumstances it is and eliminate down to specific areas of the code, which is useful with large projects.
Obviously, you'll correct the error and turn Option Explicit back on for the final compile.
Rory is offline   Reply With Quote