Solved

How to Set the Focus of a Particular Field in TDBGrid

Posted on 1998-05-13
3
438 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 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