Page 1 of 2
select Object in subform
Posted: Wed Jan 12, 2022 2:11 pm
by BDemeuse
Hi,
I have created in subform with a select object in it.
Unfortunately the values when loaded from the DB is not displayed.
It is displayed
-) when I change the type of the object into "input" text
-) when records are created from my nuBuilder application
It seems that there is not match between the values in the DB and the values of the select object.
Thanks in advance,
Bri
Re: select Object in subform
Posted: Wed Jan 12, 2022 2:36 pm
by kev1n
Hi,
Can you show your "SQL or List" for the role select?
Re: select Object in subform
Posted: Wed Jan 12, 2022 4:27 pm
by BDemeuse
In the attachment
Re: select Object in subform
Posted: Wed Jan 12, 2022 4:52 pm
by kev1n
Does an existing row also contain a numeric value ( 0,1,2,3,4) ?
Re: select Object in subform
Posted: Wed Jan 12, 2022 4:54 pm
by BDemeuse
No.... It means I need to do a translation but how ?
Re: select Object in subform
Posted: Wed Jan 12, 2022 5:03 pm
by kev1n
Run SQL Updates on your DB the replace each string with its numeric value. E.g.
Code: Select all
UPDATE your_table SET
rl_role = '0'
WHERE
rl_role = 'Donateur';
(Replace your_table with your table name)
Then replace all other string values likewise.
Code: Select all
UPDATE your_table SET
rl_role = '1'
WHERE
rl_role = 'Contact';
etc.
Re: select Object in subform
Posted: Wed Jan 12, 2022 5:11 pm
by BDemeuse
Maybe but it means in all my code (SP ...) I need to use these numerical values

No other way to escape ?
Re: select Object in subform
Posted: Wed Jan 12, 2022 5:16 pm
by kev1n
Well, instead of having a value/text pair in your SQL list
You could have the same string for the value and text.
Code: Select all
Donateur|Donateur|Contact|Contact|...
In this way the string is stored in the database.
Re: select Object in subform
Posted: Wed Jan 12, 2022 5:18 pm
by BDemeuse
oufff This is ok

Re: select Object in subform
Posted: Wed Jan 12, 2022 6:27 pm
by BDemeuse
Hi,
Still a question ... something that escapes me

In the subform (grid), I would like to have the fields ordered: role, sous_role, type but it seems it keeps the order of the form object list ... and I do not have any control
Thanks again in advance for your help.
Regards,
Bri