Base, Inserting Looped Records into Table with Button

Dear all,

First of all I am very new to Libreoffice Base and Macro and it’s Scripting Language Basic.

Can someone please help me solve my problem, please.
My problem is to insert into the table with the result from the output of a loop which is based on user input.
As you can see in the attached image My form has 2 parts.
By using the two input fields located upper part of my form, I can insert the records 1 by 1. But as shown in the lower part of the picture, I need to loop to get the records of
ab, ac, ad, ae, bc, bd, be, cd, ce, de and aa, bb, cc, dd, ee all with the values of 15 Like
ab 15
ac 15
ad 15
ae 15
bc 15 … and so on to put insert into the table.

And there also is two options with double letters rooms.

If the user is checked the double letter check box,
aa, bb, cc, dd and ee are included in the loop.

If the user left unchecked the check box,
aa, bb, cc, dd and ee are excluded.
Thanks in advanced.

Sorry, but for the moment I don’t know, why you need a macro to add lines.
.
If you use a macro connected to your add-Button, please show this macro here.
.
And please also show your query.
What is expected for your input “abcde” - silently truncate / use in a LIKE in SQL . . ?