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

How to open an Editor Form at a particular record.

Status
Not open for further replies.

Baldur3635

Technical User
Feb 15, 2010
26
0
0
BE
I could kick myself for not keeping my books.

I'm trying to do something rea;;y simple I think

I have a DBGrid and it's connected to a query. The user selects one of 5 different ItemTypes and a value (string) that he wants to find.

There can be anything from one an integer number (I doubt if it would ever ne more than 50 or so).

Once the correct record is found. The user double Clicks on the row and the Edit Form Opens (The same Form used to enter the original data. No problem these.

I have an autoincrementing integer field called id and another integer field called itemNo. I created two integer variables to hold these two values.

I tried MyTable1.Fields[0].ASInteger := id and
MyTable1.Fields[1].AsInteger := ItemNo
IManager.Show;

But neither open on the correct record, How to I get it to go to either the id or the ItemNo?

Thanks
 
The usual way to do this is to have your EditingForm contain DB enabled editing controls and point the DataSource property to the data source that your DBGrid is linked to. That way, when you show the editing form it will be sitting on the record that your DBGrid is pointed at.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top