Apr 21 2021 09:39 AM
Microsoft Access is closing unexpectedly. The strange thing is that sometimes the forms I have designed work correctly and other times the program closes unexpectedly. I think it has something to do with the programming done and updates made to Access. I use a lot of DAO to create new records, consult them, validate and so on. Before, this only happened in one form, but now it happens in 3 different forms. I have the tables in one database and the application in another, so the tables are attached in the application. I have found some tricks to try to stop the application from closing. For example, there is a form of all the products, in which I can do a search by the name of the product and when selecting the product in a combo box, I execute code to go to that product using DAO. If I open the product form and immediately search for it, the application closes. Instead, if I open the form and then go to the last product and then go back to the first (with the navigation buttons) and then search for the one I want, most of the time the application does not close. But it doesn't always work for me and it's kind of tedious to be doing this. On the other hand, there is an order form that after having added products causes the program to close, however the data has never been corrupted or lost, that new order is simply blocked and I must manually modify the table to be able to unlock the application, otherwise when I select that order the application always closes
May 10 2022 10:30 AM
May 10 2022 10:47 AM
@Beno9 It's not clear. Are you thanking the original poster? Or are you asking for help for yourself?
If the latter, we need a lot more context before we can offer any suggestions beyond the generic ones.
Make sure your code compiles. Make sure all variables are defined. Make sure EVERY module has Option Explicit at the top. Compact and Repair the accdb. Do NOT try to edit VBA in break mode.
May 15 2022 01:38 AM
May 19 2022 08:53 AM