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!

Get text of selected item

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
Hello all! I have a DBLookupListBox that has an OnExit event. If the selection is Postpone then another form opens prompting for the date to postpone to. The postpone form has a ComboBox with a list of available dates (don't want them to pull a date out of their bum, have to pick a valid date!). So once they select the date, the OnOk event updates the database with the selected date. Except it doesn't get the selected date, it gets the first date in the dropdown list. How do I get the text of the selected date to insert to the database? Thanks! (Here's the OnOk event code that's causing problems - ps convertdate is a function that takes the mm/dd/yyyy format of the selection and changes it to yyyymmdd for database formatting.)

procedure TfrmPostpone.OKBtnClick(Sender: TObject);
begin
With JMSData.qryJurorSearch do
begin
Edit;
FieldValues['TERMDATE'] := ConvertDate(cmbPPVenireList.Items.Text);
Post;
end;
Self.Close;
end; Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
I haven't used TQuery or dblookuplistbox, so I apologize in advance if my suggestion is useless.

FieldValues['TERMDATE'] :=
ConvertDate(cmbPPVenireList.SelectedItem);

Brian
 
Actually it turns out to be:

ConvertDate(cmbPPVenireList.Text);

Thanks!

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top