Very occasionally someone finds a program error and that is easy(ish), because then it's just a question of putting things right.
Most times the problem is something like - "It was working fine 'til yesterday, but now it's giving me an error (xyz) and I can't do (abc)."
The majority of these problems are usually related to the database, most often an unexpected value has been saved and the program doesn't know what to do with it. For instance - it can't read a number that it is expecting (Someone managed to insert 2 decimal points in the same number once!) The same goes for the Labels/Values file (putting an unnecessary current symbol is a good one).
When I can track these down, I write code that checks the value, so that an incorrect one cannot be saved. In fact about 30% of the program code is made up of these error-checking routines. Below is one that checks if the Moulding ID entered is a valid one.
If you are getting one of these errors then -
- Don't panic
- Make sure you have backed up the Database and Labels/Values file AND you have put them where they cannot get confused with similar files. (The database file is always called "V3.mdb" whether it contains your data or not)
- The error is likely to be on the record you were working on when the message appeared, so can you get to that and correct it, or at least see the problem?
- Do you have an earlier backup of the database you could import to check if the error is still there?
- If the above doesn't work can you open the Database in Microsoft Access to see the problem and correct it? (Make sure the result is saved as "V3.mdb" not "V3.accdb")
One of the challenges of programming is that the program you write has to work on a system that can be configured in many different ways. Very occasionally I've come across a problem I just couldn't get to the bottom of. A few years ago someone found that the program worked fine, except that it wouldn't print anything, I still don't know why. In the end it was put onto different computer and the problem went away, luckily it was the only time the problem has ever arisen.
What, of course, I haven't said is that computer errors can be immensely frustrating, testing your patience to the limit. So, put that hammer away, have a cup of tea and then tackle the problem!