Results 1 to 15 of 15
  1. #1
    Join Date
    May 2011
    Posts
    47

    Unanswered: Strange Error Message

    In MS Access 2007 I'm getting an error message when I open a form in formview. It tells me that there is code (my SQL) that is incorrect. This is not the normal error message that you get when you compile code. It lists the code that is giving me the error message. The problem is that the code is no longer there. I've deleted the control that it related to (with mousedown), erased the old code and rekeyed it, etc. But still I get the error message. It doesn't effect openning the form except that I get the error message. After I click OK everything is fine. Any help in getting rid of the error message would be much appreciated.
    Jack Kent
    Lavallette, NJ

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Did you try to compact and repair the database? If it does not work, you should create a new database and import all objects from the corrupted one. This usually is the ultimate solution to this kind of problem.
    Have a nice day!

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    In addition to Sinndho's advice about importing all objects into a new file, which I'd also advise, you should uncheck the Name AutoCorrect options, as this often causes this type of problem. Per Allen Browne's site:
    In Access 2007: Office Button | Access Options | Current Database.
    For an explanation of why, see Failures caused by Name Auto-Correct.
    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    May 2011
    Posts
    47

    Strange

    Did you try to compact and repair the database? If it does not work, you should create a new database and import all objects from the corrupted one. This usually is the ultimate solution to this kind of problem.

  5. #5
    Join Date
    May 2011
    Posts
    47

    Strange Error Messae

    Thank you both for your responses... I did do a Compact and Repair, also unchecked options as suggested. No change resulted so I'll move on to setting up a new database and importing all objects. My question is: is this a formal procedure (i.e. is there an import method)? Or should I simply create a new database and just copy everything manually to the new file?
    Thank you,
    Jack Kent

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    From inside the new file, go to File-Get External Data-Import then select all objects from the errant file.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by Missinglinq View Post
    From inside the new file, go to File-Get External Data-Import then select all objects from the errant file.

    Linq ;0)>
    A little precision: do not import the system tables, i.e. those beginning with "MSys"
    Have a nice day!

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Of course! But they're not shown by default, and virtually no newbies would even know that they exist, much less how to view them!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  9. #9
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    just a thought might be worthwhile checking for compilation errors....
    I'd rather be riding on the Tiger 800 or the Norton

  10. #10
    Join Date
    May 2011
    Posts
    47

    Strange Error Message

    Thanks again... Went through the steps of importing into a new database. All worked fine until I opened the form that was/is giving me the error message. Again I received the error message (just as before). Any other thoughts on how to eliminate this problem?

  11. #11
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    What is the exact error message you're receiving?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  12. #12
    Join Date
    May 2011
    Posts
    47

    Strane Error Message

    It is not the typical error message with a number etc. It comes up when I open FormView either from DesignView or by double clicking on the form in the "All Access Objects". It's titled Microsoft Office Access; it has an exclamation point inside a yellow triangle on the left; and it reads: Missing). ], or Item in query expression '(a portion of a WHERE clause in the SQL that I had written with an error in it). The error window has an OK and a Help button. Once I click on OK the form opens and everything works fine. I just can't get rid of the error message. I've reviewed my code and know for a fact that the bad code has been deleted, but I continue to get the error message. Any thoughts would be much appreciated. I don't know if it's appropriate to ask over this forum but I would certainly be willing to show anyone who can help over a Skype session.

  13. #13
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Is this Form based on a Query? I'd try disconnecting the Record Source for the Form, saving the Form, then re-connecting it to the Record Source again.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  14. #14
    Join Date
    May 2011
    Posts
    47

    Strange Error Message

    I think I may have solved my problem... I had a reserved word (year) in my table and the WHERE clause included in my sql (that shows up in the error) includes that reserved word. I'm now copying each object into a new db with the reserved word changed. I'll post results after I complete.

  15. #15
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Access error messages are, of course, notorious for being less than clear as to the cause of the problem! Anytime I pop an error, and go into the code module, I always look first at the line immediately before the highlighted line, and that's frequently where the actual problem lies.

    Using Reserved Words as names for Fields/Controls is always a bad idea, and for some reason, using those related to Date/Time especially so! Using Name as a name is also especially harmful!

    Glad you got this sussed out! Good luck with your project!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •