[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to Set the Focus of a Particular Field in TDBGrid

Posted on 1998-05-13
3
Medium Priority
?
441 Views
Last Modified: 2010-04-03
Hi,

I just want to know that What's the best method to Set the focus of any Specified Field in DBGrid..

My second Question is I am working in Delphi 3.0 using Local Paradox database and I want to update a table which has a Field called 'TheDate' and the datatype is Date offcourse and I want to issue a UPDATE statement and in Where Clause I want to update the record with the date criteria and I am using this statement;

UPDATE members_table
SET TheDate = :PASSDATE
WHERE members_table.members_code = :anycode

But after executing a query  delphi raises an error like  'Error in Creating Cursor'
I dont know why and whats that problem...

And tell me that:
Does SELECT statement automatically change the table state in dsBROWSE and dsEDIT after UPDATE statement or not ?

Ur help in this matter will highly appreciatable...
Thanks
Zahid

0
Comment
Question by:zahzia
  • 2
3 Comments
 
LVL 1

Expert Comment

by:michaue
ID: 1345407
I don't know what that specific error message means.  But I always use the Delphi Data Access Controls and then put a filter containing the WHERE clause into TTable, update everything and then just reset the filter.

0
 
LVL 1

Accepted Solution

by:
michaue earned 20 total points
ID: 1345408
Use the property SelectedField : TField.

SelectedField is the field component for the currently selected cell in the grid.  Set the SelectedField to move focus to a particular field in the grid.  Read SelectedField to obtain access to the field component for the currently selected cell.
0
 

Author Comment

by:zahzia
ID: 1345409
Well, I already solved the problem by myself and honestly I dont like your suggestion you are an expert(I guess) and you dont know that SelectedField is a readonly property ...
how can I set the focus with SelectedField coz SelectedField is just return the FieldName not Focus on that field...

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Screencast - Getting to Know the Pipeline
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month18 days, 10 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question