This forum has been archived. All content is frozen. Please use KDE Discuss instead.

how to open a known query line in a form

Tags: None
(comma "," separated)
User avatar
Robert Leleu
Registered Member
Posts
91
Karma
0
Hello

I have a query, I can display it and find/select a line.

I want to open the related data form. I assigned the form opening to a button in a specific "welcome form".
The data form doesn't open the selected line but the first one.

Perhaps a script ?
User avatar
jstaniek
Moderator
Posts
1027
Karma
2
OS
I see no fully automatic solution.

You can however use parametrized query so Kexi asks you about expected ID (primary key) for the record. Enter selected ID and form based on such query will display only this record. Not very handy and the form's data will not be editable.

Example:
Code: Select all
SELECT id, f FROM t WHERE t.id = [Enter ID]


Best regards,
Jarosław Staniek
• Qt Certified Specialist
KEXI - Open Source Visual DB Apps Builder
• Request a feature or fix for KEXI here
May I help you? Please mention your app's version and OS when asking for help
User avatar
Robert Leleu
Registered Member
Posts
91
Karma
0
So one has to copy the id from the list, and use the find button on the form
User avatar
jstaniek
Moderator
Posts
1027
Karma
2
OS
Robert Leleu wrote:So one has to copy the id from the list, and use the find button on the form


Yes, this is actual solution for editable data.


Best regards,
Jarosław Staniek
• Qt Certified Specialist
KEXI - Open Source Visual DB Apps Builder
• Request a feature or fix for KEXI here
May I help you? Please mention your app's version and OS when asking for help
User avatar
Robert Leleu
Registered Member
Posts
91
Karma
0
I didn't succed by scripting in the criteria column (there was a message telling my formula was not correct)

I tried the following
Starting with a numeral value (34) for the criterium I went to the SQL which read

Code: Select all
SELECT liens.trilien, lieide.idcleunik, lieide.licleunik FROM lieide, identite, liens WHERE lieide.idcleunik = 34 ORDER BY liens.trilien


which I modified to

Code: Select all
SELECT liens.trilien, lieide.idcleunik, lieide.licleunik FROM lieide, identite, liens WHERE lieide.idcleunik = [saisir idcleunik] ORDER BY liens.trilien


and received a check OK, saved, and back to the design view I found [saisir idcleunik] in the criteria column.
I tried the data view and was requested to enter the "parameter", which I did

and Kexi froze


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]