Solved

How to Set the Focus of a Particular Field in TDBGrid

Posted on 1998-05-13
3
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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