Solved

How to Set the Focus of a Particular Field in TDBGrid

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now