我正在使用Visual Basic 6.0,我正在尝试自动填写表单。text9.text作为注册日期,text10.text和到期日期。我想在text3.text中添加1年:Format $(Now,“,mmmm dd,yyyy”)输出类似于以下示例:text2.text上的2013年12月15日(今天是今天)我能以何种方式产生2014年12月15日的模拟输入,以与text9.text相同的形式输入到textbox10.text中?这是我使用的代码:
Private Sub Form_Load()
Call connect
query = "Select * from Taxi"
rsglob.Open query, connglob
If rsglob.BOF = True Then
Exit Sub
Else
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = Format$(Now, "mmmm dd, yyyy") (out put is: December 15, 2013)
Text10.Text = Format$(Now, ", mmmm dd, yyyy") (Is there any way I make it here as: ( December 15, 2014) ?
End If
Call Gen_ID(Text1)
End Sub
使用DateAdd函数
http://www.vb6.us/tutorials/understanding-vb6s-dateadd-function
DateAdd("yyyy", 1, Now)
Text10.Text = Format$(DateAdd("yyyy", 1, Now), ", mmmm dd, yyyy")
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句