我编了一个有关判断时间,并对程序进行调用的程序:
Public Function haha() As Integer
   Dim j As Integer, k As Integer
     j = 10
     k = 10
    haha = j * k
     
     
End Function
Private Sub Command1_Click()  If Now = "2004-4-30" Then
 Print haha
  End If
  End Sub可是却打印不出来haha
这是什么原因呀???

解决方案 »

  1.   

    If Format(Now, "YYYY-MM-DD") = "2004-04-30" Then Print hahaEnd If
      

  2.   

    If Now = "2004-4-30" Then
     Printer.print haha
      End If
      

  3.   

    if date=cdate("2004-4-30") then 
    ....
    end if
      

  4.   

    if date = #2004-4-30# then
    ..
    endif
      

  5.   

    顶一顶!!
    楼上好像要用Format函数!!同意二楼
      

  6.   

    下次遇到这样的情况,你看一个你的变量 是不是想得到的值! 方法:
    debug.print NOW
    ?now都可以! 不要什么问题都不动脑子,多看看软件工程之类的书! 把程序 写得严密点。
                      对待自己的工作要像艺术家对待自己的做品一样用心做。