[Solved] Set limit row for a form

Discuss the database features

[Solved] Set limit row for a form

Postby kevinT220 » Sat Nov 21, 2020 4:08 am

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 9 times
Last edited by kevinT220 on Mon Nov 23, 2020 8:33 am, edited 1 time in total.
Apache OpenOffice4.1.7
kevinT220
 
Posts: 9
Joined: Wed Nov 18, 2020 5:43 am

Re: Set limit row for a form

Postby Villeroy » Sat Nov 21, 2020 3:34 pm

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   Expand viewCollapse view
SELECT * FROM "tracking"
selects all rows and all columns from table "tracking".
Code: Select all   Expand viewCollapse view
SELECT * FROM "tracking" LIMIT 5 OFFSET 0
selects the first 5 rows and all columns from table "tracking" .
Code: Select all   Expand viewCollapse view
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, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28853
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Set limit row for a form

Postby F3K Total » Sun Nov 22, 2020 6:22 pm

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 6 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
F3K Total
Volunteer
 
Posts: 985
Joined: Fri Dec 16, 2011 8:20 pm

Re: Set limit row for a form

Postby kevinT220 » Mon Nov 23, 2020 8:33 am

thank you F3K and Villeroy.
it very useful for me.
Apache OpenOffice4.1.7
kevinT220
 
Posts: 9
Joined: Wed Nov 18, 2020 5:43 am


Return to Base

Who is online

Users browsing this forum: No registered users and 7 guests