Forum rules
For sharing working examples of macros / scripts. These can be in any script language supported by OpenOffice.org [Basic, Python, Netbean] or as source code files in Java or C# even - but requires the actual source code listing. This forum is not for asking questions about writing your own macros.

First of all, I have to apologize about my English.Secondly I have to apologize about the code.I tried lots of times to get an Access simulation, without good results. The code here shown gets most of things I wanted. However, I tried to get a key combination for all forms you have in your database, so, I changed a bit the code, in order to have a wider use. (I put a button to launch the macro, but everyone is free to use the key combination that they want.)The second thing is that I wanted to use it in all kind of controls at the same time, including subforms, so we have to avoid the use of the event.I use an UnklDonald418’s macro to sail through all forms, subforms and controls, then I use the Arineckaig’s code for ‘normal controls’ and for ‘table controls’.I’m conscious that something (or all) is wrong ( especially about ‘table controls’, in which it seems working, but the macro has to run through all controls several times).It is possible to fix this code (my mess code) a bit?

longi The code you copied from my post recursively searches the Form Document for all the table controls. I was trying to use hasFocus() to determine which table to use when copying the data. Unfortunately, once a single grid element on a table is chosen hasFocus() always returns False. By using an event Arineckaig's elegant code establishes which table to use without searching. The drawback is that each table must have an event defined for the macro to work on it. One of my original goals was to avoid having to use an event, but that appears to be impossible.The bottom line is that by placing his code inside my recursive code you are attempting to copy data on every table on the Form Document.

If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the subject line Apache OpenOffice 4.1.4 - Windows 10 Professional