你定时单击“手动按钮”试试 Private Sub Timer1_Timer() Command3_Click End Sub
你查一查msdn帮助,是不是你语法有误?
那检查用time发送时命令对不对。 有可能哪里的字母输入有误。
Private Sub Timer2_Timer() Dim mydate As Date Dim Mytime As Date Dim myyear As Integer Dim mymonth As Integer Dim myday As Integer Dim Myhour As Integer Dim Myminute As Integer Dim Mysecond As Integer dim phonenum as string
Timer2.Enabled = False mydate = Date: Mytime = Time myyear = Year(mydate): mymonth = Month(mydate): myday = Day(mydate) Myhour = Hour(Mytime): Myminute = Minute(Mytime): Mysecond = Second(Mytime) If timeoff = 0 Then If (Myminute >= 0 And Myminute <= 15) Then timeoff = 1 MSCOMM1.OUTPUT="ATDT" & phonenum & chr(34)'实际执行phonenum是通过sql库中取的,这段放在一个函数里
Private Sub Timer1_Timer()
Command3_Click
End Sub
有可能哪里的字母输入有误。
Dim Mytime As Date
Dim myyear As Integer
Dim mymonth As Integer
Dim myday As Integer
Dim Myhour As Integer
Dim Myminute As Integer
Dim Mysecond As Integer
dim phonenum as string
Timer2.Enabled = False
mydate = Date: Mytime = Time
myyear = Year(mydate): mymonth = Month(mydate): myday = Day(mydate)
Myhour = Hour(Mytime): Myminute = Minute(Mytime): Mysecond = Second(Mytime)
If timeoff = 0 Then
If (Myminute >= 0 And Myminute <= 15) Then
timeoff = 1
MSCOMM1.OUTPUT="ATDT" & phonenum & chr(34)'实际执行phonenum是通过sql库中取的,这段放在一个函数里
End If
End If
End Sub