'初始化
Private Sub Form_Load() (显示为黄色背景)
Login.Caption = "登录" ''''可在属性窗口设置‘’‘’‘’‘
txtDate = Year(Date) & "年" & Month(Date) & "月" & Day(Date) & "日"
DTPicker1.Value = Date (显示为蓝色背景)
Call pd
If datacount = 0 Then
Operater1 = "无"
Combo1.Enabled = False
txtPassword.Enabled = False
cmdOK.Visible = True
Text1.Visible = True
Else
operater.Recordset.MoveFirst
Do While operater.Recordset.EOF = False
Combo1.AddItem operater.Recordset.Fields(0)
operater.Recordset.MoveNext
Loop
Text1.Visible = False
End If
End Sub
Private Sub Timer1_Timer()
txtTime.Text = Time (显示为蓝色背景)
End Sub
'判断是否存在操作员
Private Sub pd()
operater.ConnectionString = "rovider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdbersist Security Info=False"
operater.CommandType = adCmdUnknown
operater.RecordSource = "select * from Operater"
operater.Refresh
datacount = operater.Recordset.RecordCount
End Sub
'判断是否输入密码
Private Sub txtPassword_Change()
If Len(Trim(txtPassword)) = 0 Then
cmdOK.Enabled = False
Else
cmdOK.Enabled = True
End If
End Sub