Solved

TDBDateTimePIcker

Posted on 2004-08-01
3
757 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
[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
3 Comments
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 11688459
0
 
LVL 12

Accepted Solution

by:
esoftbg earned 250 total points
ID: 11689652
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_
ID: 11691490
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

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses
Course of the Month4 days, 21 hours left to enroll

635 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