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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Fields Using an DBGrid in another Form

Status
Not open for further replies.

Venturi

Programmer
May 22, 2001
14
NL
Hi Guys,

I have a form with an sql query and an DataSource. When the query runs it displays its result in an DBGrid. On another Form i have a lot of DBEdits and stuff. On the 'DBEdit Form' i've also got an datasource, a table and a DBNavigator who talk to the same Database as the one wich runs the query. I want to click on an result in the DBGrid I want to update the 'DBEdit Form'.

I've searched for about 2 days now and haven't found an anwser how to do this :)

 
1. You can run many forms off a single dataset, so when you select a record or change data in one form, the other ones change automatically.
Have one dataset somewhere. Put a datasource on each form, all linked to your single dataset.

2. If you want to read or alter data programatically work on the datasets, not the data-aware components.
Look at
TDataset.Fields
TDataset.FieldByName
TDataset.Edit (Call before changing any field)
TDataset.Post
and all the TField properties like
asInteger
asString

Do either of these give you enough clues?
Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top