A messy application I am now responsible for, was made mostly with macros and very little code. It's a huge, unnecessarily complex application with a vast number of forms. As time goes on, I rewrite and delete.
There is a form that was opened through a macro. In past when I converted the macro to code, the form would never show when opened. I had to leave the macro in place because I didn't have time to figure out why.
Now I must use code because other stuff is needed and I'm not going mess with macros. When the form is opened in code and does not show, if I press ESC it appears. So, in code, I tried using sendkeys and ESC. That does work most of the time. Rather than doing this fifty times in a loop to insure the form opens, I would like to see why it does not show without ESC.
I made a popup debug form with a timer to show screen.activeform.name and screen.activeform.activecontrol.name. The form is opening, and if I hit tab, it walks through all the textboxes and lists, even though the form is not visible, but as soon as I hit ESC it becomes visible. It also has a tab control with a bunch of stuff on each page. I am thinking there's bad SQL or something not found somewhere, causing an error condition, and ESC is canceling the error, but I see no error. The form opening process from a macro is different than when done with code.
The problem is seen with all versions of Microsoft Access from 2000 through 2016.
Please comment if you have an idea. Thanks
There is a form that was opened through a macro. In past when I converted the macro to code, the form would never show when opened. I had to leave the macro in place because I didn't have time to figure out why.
Now I must use code because other stuff is needed and I'm not going mess with macros. When the form is opened in code and does not show, if I press ESC it appears. So, in code, I tried using sendkeys and ESC. That does work most of the time. Rather than doing this fifty times in a loop to insure the form opens, I would like to see why it does not show without ESC.
I made a popup debug form with a timer to show screen.activeform.name and screen.activeform.activecontrol.name. The form is opening, and if I hit tab, it walks through all the textboxes and lists, even though the form is not visible, but as soon as I hit ESC it becomes visible. It also has a tab control with a bunch of stuff on each page. I am thinking there's bad SQL or something not found somewhere, causing an error condition, and ESC is canceling the error, but I see no error. The form opening process from a macro is different than when done with code.
The problem is seen with all versions of Microsoft Access from 2000 through 2016.
Please comment if you have an idea. Thanks