Hello all,
I have this strange problem, and it's driving me nuts.
I'm using a TDBComboBox in Delphi, MySQL 5, and the latest stable ZeosLib.
The drop down is pre-populated with static choices.
When the user leaves the combo box I apply formatting functions to the Text property.
These changes show, but once I MySQLQuery.Post they revert back to what they were before I applied my formatting.
Also, say the user hits "c" and it pulls up the first "C" match from the drop down. Say the first match is "Computer Lab", if they hit a lower case C, it shows as "computer Lab". So my Formatting fixes it, and it displays as "Computer Lab" when leaving the box, but it posts it as "computer Lab", and then the box updates from teh record and goes back to displaying "computer Lab".
I have a custom Save button, that checks the pirmary key, and then Posts the record. If I put the formatting procedures in there just before the post, it makes no difference and does the same thing.
I tried replacing my formatting procedures with a simple:
DBCombo.Text := 'foobar';
And it does the same thing, it changes whatever was typed into the box to "foobar", but on Post it reverts back to what it was before "foobar" was assigned.
My SQLQuery beforePost and afterPost events are set to do nothing but enable and disable certain buttons.
ANY ideas?? I'm stumped as to what I'm missing..
DBComboBox.text POST problem (Delphi2K6)
Moderators: gto, cipto_kh, EgonHugeist
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Maybe you should not set the dbcombo.text property by code but the query.field value. I don't know if the text value is propagated to the dataset the same way as it is done when the user picks a value from the list.
Just a guess. I've no idea if it will work...
Just check before the post if the value is the wrong formatted version and replace it? Does that work?
Mark
Just a guess. I've no idea if it will work...
Just check before the post if the value is the wrong formatted version and replace it? Does that work?
Mark