I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

June Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi Object PASCAL Topic   Print This     

Dates

rt
Castel, -- UK
Is it possible when using a standard MaskEdit box to get the system date to appear as a default, or is there some other cunning method to do a similar thing?
rt

Thats enough of that. Ed.

 Posted 16 years ago (Thread Starter)
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #9135, 10 replies
Thread Started 2/28/2003 1:29:00 AM
View Counter=2232
Last Reply Posted 3/5/2003 6:58:00 AM)
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
rt
Castel, -- UK
Thanks, it's always the simple one!

I still have problems, but there is slow progress. By the way what do you know about "EditText" as compared to "Edit" in relation to MaskEdit boxes?
rt

Thats enough of that. Ed.

 Posted 16 years ago (Thread Starter)
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #9144 (Level 1.1)  Reply to 9135
Thread Started 3/2/2003 1:48:00 PM
View Counter=2
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
rt
Castel, -- UK
Sorry, I should have said I've read that and I always try the help files first, whoops!

Using your bit of code is fine, the date is inserted into the MaskEdit first
MaskEdit1.Text := DateToStr(Date);

But, I cannot get it to transfer to the table I other than access violations this is the latest error message I am getting -

Dataset tInvoice = Type mismatch for field 'InvoiceDate', expecting: Date actual: String

The table field InvoiceDate refuses to accept it either as a date or alpha field or anything.

What code can you suggest to get the table to accept an entry? Personally, I think it's all down to these sodding datamodules mutter, mutter, mumble. mumble etc

Thats enough of that. Ed.

 Posted 16 years ago (Thread Starter)
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #9146 (Level 1.2)  Reply to 9135
Reply Posted 3/3/2003 2:46:00 AM
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
rt
Castel, -- UK
Thanks again, they look hopeful... except I cannot get the *#$#@*&ng table to become active!

If I click the active option I get this error message which refers to the table -
"Type mismatch for field 'InvoiceDate' expecting: Date actual: String"

I even get that if I change the table field type to anything non-date.

Which is expecting the Date, is it the table or something else? This is getting heavy...

Thats enough of that. Ed.

 Posted 16 years ago (Thread Starter)
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #9155 (Level 1.3)  Reply to 9135
Reply Posted 3/3/2003 6:20:00 AM
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
rt
Castel, -- UK
It seems after all that, that the table has been corrupted - for instance despite showing fields as non-date it is still asking for date format etc Banging Head On Wall .

So I knock out a new table with no great problem, but I must be going bonkers as I can't for the life of me remember (or find) how to add it to the datamodule - which is even more stupid as I only did the same thing a week ago, has it finally driven me mad?!!? Yikes! Help......!

Thats enough of that. Ed.

 Posted 16 years ago (Thread Starter)
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #9166 (Level 1.4)  Reply to 9135
Reply Posted 3/4/2003 1:53:00 AM
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
Most Recent Post
rt
Castel, -- UK
You are, of course, quite right as I remembered later!
For some strange reason (drink, insanity, senility etc Geek Alert! etc Eek! ) I was looking to plonk the table on the DM Ashamed rather than plonk the table component on the DM and then join to that!

Thats enough of that. Ed.

 Posted 16 years ago (Thread Starter)
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #9183 (Level 1.5)  Reply to 9135
Reply Posted 3/5/2003 6:58:00 AM
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
Angel
 (Inactive)
England
MaskEdit1.Text := DateToStr(Date); Big Grin!

This will work with any string based component (Label, EditBox etc) but if using a maskedit, make sure that the mask is set to a date format.
 Posted 16 years ago
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9136 (Level 1.6)  Reply to 9135
Reply Posted 2/28/2003 1:36:00 AM
Location=England  
Joined=18 years ago   MB Posts=199  
Angel
 (Inactive)
England
Well the delphi help file probably sums it up better than I can so here goes.

Description
EditText is the value of the text for the edit control after it is formatted using the EditMask. Before the text is fully entered into a masked edit control, the EditText includes a blank character for each unentered character. As characters are entered, the blank characters in the EditText are replaced by the values that the user types.

If literal mask characters are included in the text, and no character is substituted for blanks, the values of EditText and Text are the same.

Note: EditText only applies at runtime.
 Posted 16 years ago
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9145 (Level 1.7)  Reply to 9135
Reply Posted 3/2/2003 11:52:00 PM
Location=England  
Joined=18 years ago   MB Posts=199  
Angel
 (Inactive)
England
If your table is expecting a date, just use StrToDate(MaskEdit1.Text). I seem to recall you using SQL connections, datamodules and so on so Im not sure if the following is relevant but... Think!

Table1.FieldByName('DATE').AsString := MaskEdit1.Text;
Table1.FieldByName('DATE').AsDateTime := Date;
Tabvle1.FieldByName('DATE').AsDateTime := StrToDate(MaskEdit1.Text);

Hope this helps!
 Posted 16 years ago
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9149 (Level 1.8)  Reply to 9135
Reply Posted 3/3/2003 3:57:00 AM
Location=England  
Joined=18 years ago   MB Posts=199  
Angel
 (Inactive)
England
Try double clicking your table component so that you can see what that component in Delphi thinks should be in the table. Personally I leave these empty as I use the same table component many times and for tables with different field names/ types etc. If the field INVOICEDATE is in there, delete it and see what happens.
 Posted 16 years ago
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9159 (Level 1.9)  Reply to 9135
Reply Posted 3/3/2003 6:58:00 AM
Location=England  
Joined=18 years ago   MB Posts=199  
Angel
 (Inactive)
England
I dont actually use Datamodules and never have done, but I have looked at them and if memory serves correctly, dont you just drop a table component onto the components section of the datamodule? Think!
 Posted 16 years ago
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9181 (Level 1.10)  Reply to 9135
Reply Posted 3/5/2003 5:52:00 AM
Location=England  
Joined=18 years ago   MB Posts=199  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1264A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #9135 Counter
2232
Since 4/2/2008
Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech