|
1、请问这段代码如何简化?
Private Sub Form_Timer()
Me.Label1.Caption = Time()
If Me.Label1.Caption = "09:00:00" Then
DoCmd.DeleteObject acTable, "wesun"
DoCmd.TransferDatabase acImport, "Microsoft Access", _
"\\baserver\winsuntelsy$\Log.mdb", acTable, "wesun", _
"wesun"
ElseIf Me.Label1.Caption = "11:00:00" Then
DoCmd.DeleteObject acTable, "wesun"
DoCmd.TransferDatabase acImport, "Microsoft Access", _
"\\baserver\winsuntelsy$\Log.mdb", acTable, "wesun", _
"wesun"
ElseIf Me.Label1.Caption = "14:00:00" Then
DoCmd.DeleteObject acTable, "wesun"
DoCmd.TransferDatabase acImport, "Microsoft Access", _
"\\baserver\winsuntelsy$\Log.mdb", acTable, "wesun", _
"wesun"
ElseIf Me.Label1.Caption = "18:30:00" Then
DoCmd.DeleteObject acTable, "wesun"
DoCmd.TransferDatabase acImport, "Microsoft Access", _
"\\baserver\winsuntelsy$\Log.mdb", acTable, "wesun", _
"wesun"
End If
End Sub
2、当数据库中无“WESUN”表时,怎样设定后不执行: DoCmd.DeleteObject acTable, "wesun"(代码怎样写) |
|