Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i obtain system date ?

Status
Not open for further replies.

kenguru

Programmer
May 14, 2004
173
0
0
RO
Hi,

How can i obtain the system date and use it in a form?
Thank's
Kenguru
 
Hi again!
Or it is possible to set the datepicker to be the system value?
Thanks
Kenguru
 
Hi,

It is possible to set the date/time picker's value to the current date.

If you use:

Code:
DTPicker.value = Now()

That will set the picker to the system date.

Hope this helps

Harleyquinn
 
Hi,

Sorry, forgot to respond to your first question. You can set a variable equal to Now() in the same way as the DTPicker so you can use it on your form.

Cheers

Harleyquinn
 
Hi,
I used your code but it gives me the following error problem: "Run time error 424
Object required"
DO you have why does it do this?
Kenguru
 
Sorry, I made a mistake, because i forgot that i renamed from DTPpicker to DTPdate.
Thank's again,
Kenguru
 
Hi,

If you try adding a new DTPicker to your form and use the following:

Code:
DTPicker1.Value = Now()

That should work (assuming your DTPicker is named DTPicker1 that is).

Hope this helps

Harleyquinn
 
Sorry, was typing reply as you were posting.

Glad you got it sorted out :)

Harleyquinn
 
dim strDate as string
strDate = format$(date,"hh:mm:ss")

label1.caption = strDate
 
sorry, mis-read.
For date:

Code:
Dim strDate As String
strDate = Format$(Date, "mm/dd/yyyy")

Label1.Caption = strDate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top