473,320 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Format date from textbox

Hi I am using a form to add records and my main hurdle is using 3 unbound
textboxes to add the date to a bound textbox.
EG: Unbound boxes
Tbox0 = 2006......./obviously the year and (tabstop=NO)
Tbox1 = 12 whatever I type which is day
Tbox2 = 7 whatever I type which is month
and textbox3 = bound to table[transactions] to field [TranDate]

I would like to update texbox 3 with the formatted date from the unbound
boxes in dd/mm/yyyy
which i guess will be in the After Update property

Any help will be appreciated and i may say the reason for not using the
calendar control is I am entering dates for year 2006 and that takes a lot
of mouse clicks
Regards
Graham

Aug 2 '08 #1
3 2323
On Sat, 2 Aug 2008 11:15:30 +1000, Graham Feeley wrote:
Hi I am using a form to add records and my main hurdle is using 3 unbound
textboxes to add the date to a bound textbox.
EG: Unbound boxes
Tbox0 = 2006......./obviously the year and (tabstop=NO)
Tbox1 = 12 whatever I type which is day
Tbox2 = 7 whatever I type which is month
and textbox3 = bound to table[transactions] to field [TranDate]

I would like to update texbox 3 with the formatted date from the unbound
boxes in dd/mm/yyyy
which i guess will be in the After Update property

Any help will be appreciated and i may say the reason for not using the
calendar control is I am entering dates for year 2006 and that takes a lot
of mouse clicks
Regards
Graham

Are all the records for year 2006?
Strange method to do this.
Which is the final control into which data is added.
Let's say it's [TBox2].
Code the [TBox2] AfterUpdate event:
Me.[TextBox3] = DateSerial([TBox0],[TBox1],[TBox2])

You can even forget about [TBox0].
Me.[TextBox3] = DateSerial(2006,[TBox1],[TBox2])
But ... why not use one control [TextBox3]?
Add an InputMask.
99/99/"2006";0;_

Now all the user need do is enter the month and day.
When/if you no longer want to only enter records for 2006, delete or
change the mask.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 2 '08 #2
WOW....Thans for the answer and very prompt also...Like I only posted this
five min ago...LOL
Well you are right about the Mask, just did'nt know the answer
I really appreciate it

Regards
Graham

"fredg" <fg******@example.invalidwrote in message
news:49****************************@40tude.net...
On Sat, 2 Aug 2008 11:15:30 +1000, Graham Feeley wrote:
>Hi I am using a form to add records and my main hurdle is using 3 unbound
textboxes to add the date to a bound textbox.
EG: Unbound boxes
Tbox0 = 2006......./obviously the year and (tabstop=NO)
Tbox1 = 12 whatever I type which is day
Tbox2 = 7 whatever I type which is month
and textbox3 = bound to table[transactions] to field [TranDate]

I would like to update texbox 3 with the formatted date from the unbound
boxes in dd/mm/yyyy
which i guess will be in the After Update property

Any help will be appreciated and i may say the reason for not using the
calendar control is I am entering dates for year 2006 and that takes a
lot
of mouse clicks
Regards
Graham


Are all the records for year 2006?
Strange method to do this.
Which is the final control into which data is added.
Let's say it's [TBox2].
Code the [TBox2] AfterUpdate event:
Me.[TextBox3] = DateSerial([TBox0],[TBox1],[TBox2])

You can even forget about [TBox0].
Me.[TextBox3] = DateSerial(2006,[TBox1],[TBox2])
But ... why not use one control [TextBox3]?
Add an InputMask.
99/99/"2006";0;_

Now all the user need do is enter the month and day.
When/if you no longer want to only enter records for 2006, delete or
change the mask.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Aug 2 '08 #3
On Sat, 2 Aug 2008 11:15:30 +1000, Graham Feeley wrote:
Hi I am using a form to add records and my main hurdle is using 3 unbound
textboxes to add the date to a bound textbox.
EG: Unbound boxes
Tbox0 = 2006......./obviously the year and (tabstop=NO)
Tbox1 = 12 whatever I type which is day
Tbox2 = 7 whatever I type which is month
and textbox3 = bound to table[transactions] to field [TranDate]

I would like to update texbox 3 with the formatted date from the unbound
boxes in dd/mm/yyyy
which i guess will be in the After Update property

Any help will be appreciated and i may say the reason for not using the
calendar control is I am entering dates for year 2006 and that takes a lot
of mouse clicks
Regards
Graham
The month is the last entry?
If this is how you wish to do this, code the Tbox2 AfterUpdate event:
Me.TextBox3 = DateSerial([TBox0],[TBox2],[TBox1])

However, why not forget about those 3 controls and just code the
Textbox3 AfterUpdate event:
Me.Textbox3 = DateSerial(2006,Month(Textbox3]),Day([TextBox3]))

Enter 9/12 in [Textbox3] and it will become 9/12/2006
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 26 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: praba kar | last post by:
Dear All, In Php we can print RFC 2822 formatted date by date('r') with parameter r. Then it will print the below format date. "Thu, 7 Apr 2005 01:46:36 -0300". I want to print same RFC 2822...
2
by: amith | last post by:
hi I have written javascript for comparing two dates in US format and finding out whether the start date is greater than the end date and vice versa. In this attempt i have instantiated the...
4
by: peashoe | last post by:
I have an asp page that uses a calendar.js (pop-up) file to add an exact date format in the text field (txtDDate). My problem is I need some javascript that sets an alert that does not allow them...
6
by: dyw55a | last post by:
How to implement mm/dd/yyyy format for textbox? I have text box with format mm/dd/yyyy. Now I want the cursor i generated whenever user highlight this textbox and whatever user inpu replace one...
0
by: lsy | last post by:
i wonder how can i order my statement interm of "ORDER BY FORMAT(Date, 'mmmm')" with using this it will order by alphabethical but i want it order by month... i had try "ORDER BY FORMAT(Date, 'mm')"...
1
by: Kerri | last post by:
Hi, I am new to .NET. I have a server side text box on an ASPX Page. I want to format the date when the user tabs out / double clicks teh textbox or presses carriage retutrn. What event do...
1
by: G Gerard | last post by:
Hello I am having some problem comparing dates with the SQL statement below MySQL = "SELECT Format(Date, 'yyyy/mmmm/dd') as FROM TblDates WHERE _ Format(Date, 'yyyy/mmmm/dd') =...
2
by: fniles | last post by:
How do you do Format(Date, "mmddyy") in VB.NET ? Thank you
8
by: libsfan01 | last post by:
how can i use regular expressions to ensure a mysql format date entry in a text field? thanks marc
5
mgpsivan
by: mgpsivan | last post by:
Hi, i have form in Asp.net(2003) in that i've to change the format of the date by the following statement Format(Date.Today, "dd/mm/yyyy") but when i give this code the month part displays as...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.