Solved

How to Set the Focus of a Particular Field in TDBGrid

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

11 Experts available now in Live!

Get 1:1 Help Now