Runtime error on changing selection

Going back to your code, it errors/stops at this line right:
Code:
Me.SubFrmDepositTransactions.Enabled = False
Comment out this line and the line after it, then re-run the code step-by-step by putting a breakpoint at the first line.
 
Going back to your code, it errors/stops at this line right:
Code:
Me.SubFrmDepositTransactions.Enabled = False
Comment out this line and the line after it, then re-run the code step-by-step by putting a breakpoint at the first line.

:banghead: Now it stopped in another line. Everytime I run the code it stops in a different line :mad:


Note that I tried it in two different versions of the same database with a slightly different order in code lines . Same thing happens. It's obvious it's not a specific line of code.
 
Last edited:
I understand that. Can you see a pattern? Does it stop when an "Enabled" property is called? Or when a property of a particular type of control is called?
 
I understand that. Can you see a pattern? Does it stop when an "Enabled" property is called? Or when a property of a particular type of control is called?

No there isn't a pattern. I ran the code only using the *page.Visible lines and then only using the *form.Enabled ones. Still it stops whenever....


I'll try to replace the If statements with a "SELECT CASE" one just to see what happens, although I'm starting to believe that something is going on with the complexity of structure and count of objects. Next step is to try to divide the database into two subdatabases......it's haunting!!! (yet challenging)
 
A stripped version of the database is almost impossible, I'll try it though but is gonna take some time. Meanwhile there's the code behind the on currnet event, that seems to cause the problem.
Why almost impossible?
The only thing we need is the 3 forms and some sample data?
 
Why almost impossible?
The only thing we need is the 3 forms and some sample data?

Actually there's a main form, with two subforms, and the second subform has 4 subforms in a tab control. So there are 7 forms, and the underlying queries and tables, all of them with label captions in Greek. Data is also in Greek. It would be easier for me to redesign it from scratch than to change all that.


Meanwhile just tested the Select Case statement instead of IF and came up with the same error message.
Noticed though, that when subformB loads as main form (not nested in Main form that is) works perfectly alright by changing records. Problem comes when putting it as a subform in main form and try to change records by selecting a record from subformA. Hope with helps you people detect something, I didn't, my mind is like yoghurt right now.
 
Update!


You won’t believe it!
During form design, especially when I have to connect a bunch of subforms with a main form and with each other, I usually leave all controls (even the autonumber ones) enabled and visible so I can check if everything works right. In my case there were a couple of dozens of such controls, that seemed to cause the problem every time forms were loading. Finalizing the design of the main form and cutting out (not visible) all unneeded controls, everything works fine. It seems in the end, it was a machine problem, which would come up only in my machine.


Thanks to everyone who helped!!! You’re awesome.
 

Users who are viewing this thread

Back
Top Bottom