Locate a record and show that record on a form
- From: "Dan" <danno492_NOSPAM@xxxxxxxxxxx>
- Date: Mon, 13 Jun 2005 20:34:39 -0400
The Below code works fine when opening a form to location a selected record.
However, when using this same code on the Change event of my combobox, the
form record does not show the new recored.
Anyone know what I am doing wrong here?
procedure TfrmCustomers.cxCustomersPropertiesChange(Sender: TObject);
var CustomerID : integer;
var strfield, strvalue: string;
opts : TLocateOptions;
begin
CustomerID := cxCustomers.EditValue;
strfield := 'CustomerID';
strvalue := IntToStr(CustomerID);
opts := [loCaseInsensitive];
if not datPPM.datCustomers.DataSet.Locate(strfield, strvalue, opts) then
ShowMessage(strvalue + ' not found in ' + strfield)
else
datPPM.datCustomers.DataSet.Locate(strfield, strvalue, opts);
end;
.
- Follow-Ups:
- Re: Locate a record and show that record on a form
- From: Dan
- Re: Locate a record and show that record on a form
- From: Kostas Terzides
- Re: Locate a record and show that record on a form
- From: Bill Todd
- Re: Locate a record and show that record on a form
- Prev by Date: Re: How to check if table exists
- Next by Date: Re: Please help Dynamic ADO Query
- Previous by thread: Updates not applied when using cloned datasets
- Next by thread: Re: Locate a record and show that record on a form
- Index(es):