Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't post TDBLookupCombobox KeyValue updated at runtime 1

Status
Not open for further replies.

purpledawn

Programmer
Jun 21, 2001
50
US
I am having troubles posting a value to a database from a DBLookupCombobox that has been updated at runtime.

If the value is set normally by the user selecting a value from the list in the combo box, the value posts OK.

If I set the KeyValue property at runtime (to a value that is in the KeyList), the KeyValue and Text property read that it has been changed. After I issue a Post command on the Dataset and then reread the KeyValue or Text property on the Combobox, it reverts to the value it was just before it was set at runtime! If I look at the record in the database, the value has not been updated properly. I am even issuing Refresh after setting KeyValue.

Someone, please tell me what I am missing!
 
You could try updating the underlying field directly. The control will get notification of the change and the control will be updated with the value that you set.
 
Thanks for your reply. I did think of a more nuclear approach (I was thinking update SQL, but I guess you mean update the value of the Field object on the Dataset, or something like that, which is better), but I wanted to see if there was a work-around for the Combobox.

Thanks again, I'll give that a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top