各位。。我是菜鸟,刚学的VB
现在我想 自己在imputbox里或者textbox里输入一个时间,然后让程序判断是否等于系统时间
如果等于就执行某一个事件这样要怎样写代码
谢谢

解决方案 »

  1.   

    if trim(text1.text)=format(date,"yyyy-mm-dd" )then
    ......
      

  2.   

    If CDate(Me.Text1.Text) = Format(Date, "YYYY-MM-DD") Then
        MsgBox "OK", vbCritical
    End If
      

  3.   

    if cdate(text1.text)-date=0 then
      msgbox "是同一天"
    end if
      

  4.   

    If Val(Text1.Text) = Date() Then xxxxxxxxxxxxxxxxxxxxxx
      

  5.   

    If IsDate(Text1) Then
        If CLng(CDate(Text1)) = CLng(Now) Then
            MsgBox "嘿嘿"
        End If
    End If
      

  6.   

    do while 1<>2
        msgbox "你们太有才了!"
    loop
      

  7.   

    把输入框中的字符串换算成日期或时间格式,然后用datediff函数判断。
    If DateDiff("s", CDate(Text1), Time()) = 0 Then MsgBox "ok"
      

  8.   

      可以使用DateValue和TimeValue两个函数来判断是否等于系统日期或时间:    if datevalue(textbox.text)=dativalue(now) then   if timevalue(textbox.text)=timevalue(now) then
      

  9.   

    用DateDiff判断您输入的是否与比较值有差异就可以了。DateDiff的用法网上到处都是,随便搜一下就可以了。