 |
 |

03-29-2003, 04:56 PM
|
 |
Regular
|
|
Join Date: Sep 2002
Posts: 78
|
|
Date Question
|
Hey,
I have a question for you guys and hopefully someone will be able to help. What I want to do is display the date e.g "Sunday 30 March, 2003" and maybe the time too if possible in a text box "TxtDate".
I've also got a calander on my form and I was wondering how to keep a running date...that is how to get the date to change everyday etc...any help would be great
thanks in advance 
|
|

03-29-2003, 05:03 PM
|
 |
Junior Contributor
|
|
Join Date: Feb 2003
Location: Philippines
Posts: 336
|
|
Quote: Originally Posted by geek Hey,
I have a question for you guys and hopefully someone will be able to help. What I want to do is display the date e.g "Sunday 30 March, 2003" and maybe the time too if possible in a text box "TxtDate".
I've also got a calander on my form and I was wondering how to keep a running date...that is how to get the date to change everyday etc...any help would be great
thanks in advance 
try txtDate.text = Now()
|
|

03-29-2003, 05:05 PM
|
 |
Senior Contributor
|
|
Join Date: Jun 2002
Location: Where Heaven & Hell meet
Posts: 813
|
|
|
Format(Now(),"dddd dd mmmm, yyyy")
|
__________________
"They say the the world will end in the same way it was created. I disagree, I think it'll end without the internet" ~ Kaluriel 2001
"The edit button is mightier than the doublepost" ~ Kaluriel 2003
|

03-29-2003, 05:07 PM
|
 |
Regular
|
|
Join Date: Sep 2002
Posts: 78
|
|
I tried that but it doesn't seem to work *shrugs* 
|
|

03-29-2003, 05:09 PM
|
 |
Senior Contributor
|
|
Join Date: Jun 2002
Location: Where Heaven & Hell meet
Posts: 813
|
|
__________________
"They say the the world will end in the same way it was created. I disagree, I think it'll end without the internet" ~ Kaluriel 2001
"The edit button is mightier than the doublepost" ~ Kaluriel 2003
|

03-29-2003, 05:12 PM
|
 |
Regular
|
|
Join Date: Sep 2002
Posts: 78
|
|
neither...what should I have as the Private Sub TxtDate_"" () if that even makes sense....I'm not really good with this sort of thing...hehe

|
|

03-29-2003, 05:17 PM
|
 |
Senior Contributor
|
|
Join Date: Jun 2002
Location: Where Heaven & Hell meet
Posts: 813
|
|
Have a timer on the form, and put this in the code. Set the interval at 1000 and enabled = true, that should update every second
Code:
Private Sub Timer1_Timer()
txtData.Text = Format(Now(),"dddd dd mmmm, yyyy" )
End Sub
|
__________________
"They say the the world will end in the same way it was created. I disagree, I think it'll end without the internet" ~ Kaluriel 2001
"The edit button is mightier than the doublepost" ~ Kaluriel 2003
|

03-29-2003, 05:18 PM
|
 |
Tachikoma
|
|
Join Date: Mar 2003
Location: Mansfield, UK
Posts: 4,594
|
|
Quote: Originally Posted by geek neither...what should I have as the Private Sub TxtDate_"" () if that even makes sense....I'm not really good with this sort of thing...hehe

i'd say put this it in a timer
|
|

03-29-2003, 05:23 PM
|
 |
Regular
|
|
Join Date: Sep 2002
Posts: 78
|
|
I did that and I got a run-time error '424' - object required.... 
|
|

03-29-2003, 05:24 PM
|
 |
Junior Contributor
|
|
Join Date: Feb 2003
Location: Philippines
Posts: 336
|
|
Quote: Originally Posted by geek neither...what should I have as the Private Sub TxtDate_"" () if that even makes sense....I'm not really good with this sort of thing...hehe

Try this one:
txtDate.text = FormatDateTime(Now(),vbLongDate) & " " & FormatDateTime(Now(),vbLongTime)
it should work.
Note that txtDate is a textbox
|
|

03-29-2003, 05:27 PM
|
 |
MetaCenturion
Retired Moderator * Guru *
|
|
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
|
|
Quote: Originally Posted by geek I did that and I got a run-time error '424' - object required.... 
What line do you get run-time error 424 on?
Make sure that you changed the name to the control that you have on your form.
i.e.
Text1.Text if your TextBox's name is Text1.
|
|

03-29-2003, 05:28 PM
|
 |
Regular
|
|
Join Date: Sep 2002
Posts: 78
|
|
Wow...thanks soooo much it works....  you're a legend!! Thanks everyone for your help and your patience...hehe... 
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|