Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inserting Date into TextBox

I have a textbox called "DateTextBox" on form "MAINFORM".

I want to put the current date into the box when the form opens
in the format dd-mm-yy.

Please can someone suggest a way to do this.


TI

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Inserting Date into TextBox

With MAINFORM
.DateTextBox.Text = Format(Date,"dd-mm-yy")
.Show
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jako " wrote in message
...
I have a textbox called "DateTextBox" on form "MAINFORM".

I want to put the current date into the box when the form opens
in the format dd-mm-yy.

Please can someone suggest a way to do this.


TIA


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inserting Date into TextBox

Can we add the time to this to update in real-time

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Inserting Date into TextBox

Depends what you mean by real time. It would be easy to have the textbox
updated upon a certain event as long as the form is still up, just a simple

With MAINFORM
.DateTextBox.Text = Format(Date,"dd-mm-yy hh:mm:ss")
End With

If you want the textbox ticking over each second, then that is much more
complex. You would need a timer. You could use OnTime, but I would
personally use the Windows timer, and have a callback to manage the updates.

I could knock you up a sample workbook if you are interested, and you give
me your email address.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"scottnshelly " wrote in
message ...
Can we add the time to this to update in real-time?


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date format textbox? Tdp Excel Discussion (Misc queries) 2 October 15th 08 08:11 PM
Textbox to show date K1KKKA Excel Discussion (Misc queries) 2 October 22nd 07 11:32 PM
Date format textbox George Excel Discussion (Misc queries) 2 September 20th 06 09:09 PM
Date format in textbox Bruce Excel Programming 1 April 15th 04 04:28 PM
converting date from a textbox to a date format neowok[_17_] Excel Programming 5 February 23rd 04 01:40 PM


All times are GMT +1. The time now is 02:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"