Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TDBDateTimePIcker

Posted on 2004-08-01
3
Medium Priority
?
771 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 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
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: …
Suggested Courses

721 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