[Solved] Set limit row for a form

Discuss the database features
Post Reply
kevinT220
Posts: 11
Joined: Wed Nov 18, 2020 5:43 am

[Solved] Set limit row for a form

Post by kevinT220 »

How can i set the form only allow enter 25 data then auto jump to second form?
Please take a look on file.
IS this possible to do?
Attachments
test1.odb
(10.98 KiB) Downloaded 159 times
Last edited by kevinT220 on Mon Nov 23, 2020 8:33 am, edited 1 time in total.
Apache OpenOffice4.1.7
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Set limit row for a form

Post by Villeroy »

The status bar of your database document reads "HSQLDB embedded". This means that the database document contains a database which is documented here: http://www.hsqldb.org/doc/1.8/guide/ch09.html

Code: Select all

SELECT * FROM "tracking"
selects all rows and all columns from table "tracking".

Code: Select all

SELECT * FROM "tracking" LIMIT 5 OFFSET 0
selects the first 5 rows and all columns from table "tracking" .

Code: Select all

SELECT * FROM "tracking" LIMIT 5 OFFSET 5
selects the next 5 rows and all columns from table "tracking".
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
F3K Total
Volunteer
Posts: 1038
Joined: Fri Dec 16, 2011 8:20 pm

Re: Set limit row for a form

Post by F3K Total »

Hello,
if i got you right, you always want to display 25 rows in a grid, if reached, then restart with an empty grid.
This is possible, by using SQL and the possibilities of form design.
I made an example.
To distinguish the trackingnumbers for each gridcontent, i introduced an extra column "FK_GRIDNUMBER" into table "tracking".
Query "qGRIDNUMBER" does calculate by counting all trackingnumbers, which gridnumber is currently needed, using SQL COUNT() and MOD() functions.
This query is the base of a form, serving this gridnumber automatically to table tracking, column "FK_GRIDNUMBER".
After inserting 25 rows, the gridnumber served will be increased by 1 and the inputgrid on the left of the form will be empty.
Find the sample file attached.
If you open the form, you will find 23 tracking numbers in the currently active left grid number 3, add two more tracking numbers and you will see the effect after hitting the "save row / update forms" button, the left grid will be empty for restarting new 25 rows into new grid number 4. And so on, it will work till 1000 grids as currently designed.
To display any grid, select top right a gridnumber using the listbox, an hit the "save row / update forms" button again.
The selectable grids in this listbox will rise automatically according grids are filled.
R
Attachments
25Rows.odb
(17.48 KiB) Downloaded 195 times
  • MMove 1.0.6
  • Extension for easy, exact positioning of shapes, pictures, controls, frames ...
  • my current system
  • Windows 10 AOO, LOLinux Mint AOO, LO
kevinT220
Posts: 11
Joined: Wed Nov 18, 2020 5:43 am

Re: Set limit row for a form

Post by kevinT220 »

thank you F3K and Villeroy.
it very useful for me.
Apache OpenOffice4.1.7
Post Reply