Delphi7 Input form
Posted: 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
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