将文本框的字符串转换为dd / mm / yyyy格式 [英] Convert the string of the textbox to dd/mm/yyyy format
问题描述
您好,我想将文本框的字符串转换为dd / mm / yyyy格式。我试过了:
Hello, I wanted to convert the string of the textbox to dd/mm/yyyy format. I tried:
On Error GoTo ErrHandler:
On Error GoTo ErrHandler:
Dim dateStart As Date
Dim dateStart As Date
dateStart = CDate(date_from .Text)
dateStart = CDate(date_from.Text)
退出Sub
ErrHandler:
ErrHandler:
dateerror = Msgbox("你输入的日期)格式不正确。请使用dd / mm / yyyy格式重新输入。")
dateerror = Msgbox("The date you entered was not in the correct format. Please re-enter using dd/mm/yyyy format.")
当我在文本框中输入字母时,它确实有错误msgbox,但是我按下确定,它没有退出msgbox,它只是不断重现。
When I enters alphabets in the textbox, it did has this error msgbox, but when I pressed ok, it doesn't exit the msgbox, it just keeps reappearing.
有人知道吗?
推荐答案
您好,
文本框的内容是什么。你能给出一个例子。
what is the content of the textbox. Can You give an example.
问Ellen
这篇关于将文本框的字符串转换为dd / mm / yyyy格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!