Remove Hours, Minutes and Seconds from Date Field

T

Tony

I have a last order date that is creating problems on my Web Page. It has
worked for years and now I have learned that I must remove the Hours, Minutes
and Seconds from the date field. I tried the following code but I get
invalid data. Run Time Error 2113

Any Help would be appreciated.

Dim bytMonth As String
Dim bytDay As String
Dim intYear As Integer
Dim strYear As String
Dim HldDate As String

bytMonth = DatePart("m", Me!HCLBKDT)
bytDay = DatePart("d", Me!HCLBKDT)
intYear = DatePart("yyyy", Me!HCLBKDT)
strYear = Right(intYear, 2)

HldDate = "#" & bytMonth & "/" & bytDay & "/" & strYear & "#"

Me!HCLBKDT = HldDate ' Run Time Error 2113 Here.

Thank You

Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top