
I have a Patch to my database that isn't working even though the syntax is identical to another location what works perfectly.
the following is in the OnSelect property of a button:
If( Connection.Connected && CountRows( ColInspections)>0, Collect( todaysFHs, ColInspections); Collect( Inspections, ColInspections); Clear( ColInspections); SaveData( ColInspections, "LSInspections") , Connection.Connected && CountRows( EditsHoodList)>0, Patch( HoodList, BRHoodList, EditsHoodList); Refresh( HoodList); ClearCollect( RefHoodList, HoodList); Clear( EditsHoodList); Clear( BRHoodList); SaveData( RefHoodList, "LSRefHoodList"); SaveData( EditsHoodList, "LSEditsHoodList"); SaveData( BRHoodList, "LSBRHoodList") )
The Patch in question is halfway through. I've checked the contents of BRHoodList and EditsHoodList and they are fine. I've also run that exact patch with HoodList replaced with a copy of the table called RefHoodList. And I've put the patch as seen above Patch( HoodList...) on a button without any other code and it worked.
I think that the Patch is not able to complete because the tables used in the patch are cleared in the following lines of the above code.
If I'm right, how can I work around this and still reconcile my data all in one click?
If I'm wrong, what might be going on?
You can always try to add the code that needs a delay to a timer and then kick the timer off in you onselect code.