elds(i).Name
Txt(i).DataField=DataA.Recordset.Fields(i).Name
Nexti
Txt(13).DataField=DataA.Recordset.Fields(10).Name
IfFrmMain.cuAp>-1Then
DataA.Recordset.Move(FrmMain.cuAp)
Else
DataA.Recordset.MoveFirst
EndIf
Else'salary
Frame1.Visible=False
Cmbdegree.Visible=False
Cmbdepart.Visible=False
Fori=0To12
Lab(i).Caption=DataA.Recordset.Fields(i).Name
Txt(i).DataField=DataA.Recordset.Fields(i).Name
Nexti
Txt(13).DataField=DataA.Recordset.Fields(15).Name
Txt(7).Locked=True
Txt(11).Locked=True
Txt(12).Locked=True
IfFrmMain.cuAp>-1Then
DataA.Recordset.Move(FrmMain.cuAp)
Else
DataA.Recordset.MoveFirst
EndIf
EndIf
EndSub
PrivateSubForm_Unload(CancelAsInteger)
FrmMain.Enabled=True
FrmMain.SetFocus
UnloadMe
FrmMain.DataB.Refresh
EndSub
OptionExplicit
ConstMxUser=100
PublicEmploIDAsInteger
PublicCurUserAsString
PublicCurIdAsString
PublicCurPswAsString
Dimuser(MxUser),pws(MxUser),state(MxUser),Emplo(MxUser)AsString
PrivateSubForm_Load()
DimiAsInteger
IfApp.PrevInstanceThen
MsgBox("程序已经运行,不能再次装载。"),vbExclamation
UnloadMe
EndIf
'本段代码用于判定本程序是否已经装载于内存中,以避免程序的多重启动
i=0
OpenApp.Path+"\user.ini"ForInputAs#1
DoWhileNotEOF(1)
Input#1,user(i),pws(i),state(i),Emplo(i)
Ifstate(i)="A"Then
Combo1.AddItemuser(i)
EndIf
i=i+1
Loop
Close#1
Combo1.ListIndex=1
'在窗口装载阶段读取用户设置文件获取用户信息并装载于用户列表框中
EndSub
PrivateSubCmdCancel_Click()
UnloadMe
End
EndSub
PrivateSubcmdOK_Click()
IftxtPassword=pws(Combo1.ListIndex)Then
CurId=Combo1.ListIndex
EmploID=Emplo(CurId)
CurUser=user(CurId)
CurPsw=pws(CurId)
Me.Hide
'LoadFrmMain
FrmMain.Show
Else
MsgBox"InvalidPassword,tryagain!",,"Login"
txtPassword.SetFocus
SendKeys"{Home}+{End}"
EndIf
EndSub
PrivateSubForm_Unload(CancelAsInteger)
UnloadMe
End
EndSub
OptionExplicit
PubliccuTabChAsBoolean
PubliccutableAsString
PubliccuApAsInteger'当前指针位置
DimiAsInteger
PublicPwinAsString
PublicSubshowemployee()
DataA.RecordSource="select*fromemployee"
DataA.Refresh
DBGA.Columns("性别").Button=True
DBGA.Columns("学历").Button=True
DBGA.Columns("部门").Button=True
Fori=0To2
Mtab(i).Checked=False
Nexti
Mtab(0).Checked=True
cutable="employee"
cuTabCh=True
EndSub
PublicSubshowleave()
DataA.RecordSource="select*fromleave"
DataA.Refresh
Fori=0To2
Mtab(i).Checked=False
Nexti
Mtab(1).Checked=True
cutable="leave"
cuTabCh=True
EndSub
PublicSubshowsalary()
DataA.RecordSource="select*fromsalary"
DataA.Refresh
Fori=0To2
Mtab(i).Checked=False
Nexti
Mtab(2).Checked=True
cutable="salary"
cuTabCh=True
EndSub
PrivateSubForm_Load()
Dimfil,tbcount,iAsInteger
DimTbstr(50),Tbnam(50)AsString
DataA.DatabaseName=App.Path+"\sm.mdb"
DataB.DatabaseName=App.Path+"\sm.mdb"
DataB.RecordSource="select*fromemployee"
Callshowemployee
IfDir(App.Path+"\table.ini")=""Then
LsDegree.AddItem"定制"
LsDepart.AddItem"定制"
Else
fil=FreeFile()
OpenApp.Path+"\table.ini"ForInputAs#fil
DoWhileNotEOF(fil)
Input#fil,Tbnam(i),Tbstr(i)
i=i+1
Loop
Close#fil
tbcount=i
Fori=0Totbcount
IfTbnam(i)="lsdegree"Then
LsDegree.AddItemTbstr(i)
ElseIfTbnam(i)="lsdepart"Then
LsDepart.AddItemTb
上一篇:
vb企业人事管理系(论文和程序)
下一篇:
对硕士毕业生迁移失业目的地的实证研讨