Delphi7 Input form

Delphi7 Input form

Postby Hans » Wed 24 Aug 2005 20:19

Hi,

I created a Form using some edit controls (DBEdit) connected to a TMyTable via a datasource. I call ClearFields to start with a blank form and want to be able to search the database for records containing the data I entered in one or more editfields. I want than be able to select one record an fill in the form.

After I have choosen the record I use the Locate function to select the record which should fill in the edit fields in my form. But, I get an error about some foreign key. I guess it is because the component thinks I am editting an existing record. When I call disablecontrols first it seems to work, but I feel this is not the wright way to do.

Does anyone of you know a better way to accomplish this?

best regards,
Hans
Hans
 
Posts: 52
Joined: Wed 24 Aug 2005 20:05

Postby Ikar » Thu 25 Aug 2005 11:48

> I guess it is because the component thinks I am editting an existing record.

DBEdit serves to edit the current record. Use another component instead.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components