Solved

TDBDateTimePIcker

Posted on 2004-08-01
3
724 Views
Last Modified: 2008-01-09
I Need Help Please ,

I am writing a DB program for Workshop Bookings,I am using ADO and D7.How do i link the DBDatePicker to a DB Grid that when you select a new date the DBGrid will display the selected date details only so that new details can de added/Edited on the selected date
0
Comment
Question by:faizsnell
3 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
Comment Utility
0
 
LVL 12

Accepted Solution

by:
esoftbg earned 250 total points
Comment Utility
example from:
page:        http://www.geocities.com/esoftbg/
  link:        Q_21078424.zip

//........

uses
  ...., DateUtils;

procedure TForm1.ADOQueryLISTNewRecord(DataSet: TDataSet);
begin
  ADOQueryLIST.FieldByName('MOMENT').AsDateTime := Today;
end;
0
 
LVL 2

Expert Comment

by:DarkCore_
Comment Utility
Let the user choose the date anywhere in your project

I think you can do the following. Use an ADOQuery to retrieve the values, for example, "SELECT .... WHERE Date = :Date", where param "Date" should be the date selected

Then, when user inserts new record, you can assign the new date to your field, if you control it manually:
   .....
   mydataset.insert;
   mydataset.fieldbyname('date').AsDateTime := choosendate;
   ....

or automatically in the "AfterInsert" event of ADOQuery

Of course, if you use DBGrid you can set the column with the "Date" field readonly.

Edu
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

9 Experts available now in Live!

Get 1:1 Help Now