Frothingslosh
Premier Pale Stale Ale
- Local time
- Yesterday, 23:37
- Joined
- Oct 17, 2012
- Messages
- 3,276
Okay, in a nutshell, I have this form that generates its underlying SQL when it is opened and assigns the recordset as part of a procedure called by Form_Open. One of the things I do is check to see if the recordset is empty, and if so, I notify the user. However, the users have requested that the message pop up AFTER the form is visible.
So what I had done, and what had worked until roughly two weeks ago, is skip the recordcount check (which is separated into its own procedure for this very reason) when the UpdateRecordset procedure runs as part of Form_Open, and run it directly at the end of Form_Load. (There is a call to the record count check at the end of UpdateRecordset, but it's buried inside an IF...THEN.)
Until a week or two ago, this worked fine. The form would get a recordset assigned, the form would load, and then the message would come up if the recordset was empty.
Now, however, instead of UpdateRecordset completing its processing, when the forms RecordSource property gets set, processing is immediately passed to Form_Load, then Form_Activate, then Form_Current, and only then does UpdateRecordset continue processing. This is new behavior; it only started happening in the last two weeks. (I did some extensive modificationof the view behind this screen two weeks ago, which meant I opened this screen roughly a bajillion times and this never happened.)
I'm curious - has anyone else run into this, is this new behavior, or was it always supposed to act like this and my system was just running wrong the last 9 months?
I can provide the code if you want, but it's technically working as written. It's just the logic is now messed up due to the sudden change in event calling, so I need to determine if I can just undo the workaround I put in 9 months ago (when calling the warning code during the Form_Open sequence caused it to display BEFORE the form was visible) or if I need to figure out a solution that automatically checks to see if the form is visible to the user before displaying the message and delays the message if it isn't...without being able to rely on knowing whether or not Form_Load has fired yet or not.
So what I had done, and what had worked until roughly two weeks ago, is skip the recordcount check (which is separated into its own procedure for this very reason) when the UpdateRecordset procedure runs as part of Form_Open, and run it directly at the end of Form_Load. (There is a call to the record count check at the end of UpdateRecordset, but it's buried inside an IF...THEN.)
Until a week or two ago, this worked fine. The form would get a recordset assigned, the form would load, and then the message would come up if the recordset was empty.
Now, however, instead of UpdateRecordset completing its processing, when the forms RecordSource property gets set, processing is immediately passed to Form_Load, then Form_Activate, then Form_Current, and only then does UpdateRecordset continue processing. This is new behavior; it only started happening in the last two weeks. (I did some extensive modificationof the view behind this screen two weeks ago, which meant I opened this screen roughly a bajillion times and this never happened.)
I'm curious - has anyone else run into this, is this new behavior, or was it always supposed to act like this and my system was just running wrong the last 9 months?
I can provide the code if you want, but it's technically working as written. It's just the logic is now messed up due to the sudden change in event calling, so I need to determine if I can just undo the workaround I put in 9 months ago (when calling the warning code during the Form_Open sequence caused it to display BEFORE the form was visible) or if I need to figure out a solution that automatically checks to see if the form is visible to the user before displaying the message and delays the message if it isn't...without being able to rely on knowing whether or not Form_Load has fired yet or not.