LO 7.4 running on Linux Mint 20, jdbc:Mysql 8
I am duplicating the recommended method to Update a Listbox based on a changed value in another ListBox as discussed in post 31801. The Macro is linked to Item status changed
in daoname list box and in After record change
on MainForm. When the Form loads it fires off the After Record Change event before the form is populated with data so tVal comes up null and the SQL Query fails when the form is opened. Once I acknowledge the errors and select the same value in the first ListBox (kicking off Item Status Changed) the macro executes and the second ListBox is correctly populated. The problem seems to be in the event sequence. If After Record Change would fire off after the form is populated, tVal would be set and the Query would run correctly.
This also fails on creating a new record as tVal is null, so will have to test for array(strSQL) is null (not sure how) then re-run query without dao-dist
.daoid
= " + tVal.
And this Sub won’t trigger an On Error event to process in the Sub.