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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Date to put current date in a field 2

Status
Not open for further replies.

kiwieur

Technical User
Apr 25, 2006
200
GB
Hi people,
can anyone see what is wrong with this small piece of code please. When I try to run it I get the message invalid use of Null and it highlights the line.

CLdate = Date

Code:
Private Sub Closed_AfterUpdate()
Dim CLdate As String
CLdate = Date
[ClosedDate] = CLdate
End Sub

Regards

Paul

 


Hi,

Dates and not strings.

Dates are NUMBERS. faq68-5827
Code:
Private Sub Closed_AfterUpdate()
  [ClosedDate] = Format(Date, "ddd mmmm dd yyyy")
End Sub


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Seems like you have a control named Date.
What about this ?
Code:
CLdate = VBA.Date

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Skip/PHV,

Sorry for not replying sooner and thanks for your input, PHV was right I did have a contol named date I have changed this to DDate and now all is OK

Regards

Paul

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top