发布时间 : 星期五 文章基于Access 2003数据库开发设计的教学管理系统-大学毕业论文毕业设计学位论文范文更新完毕开始阅读f643d9f07c1cfad6195fa7b7
代码:Option Compare Database
Private Sub Command18_Click()
On Error GoTo Err_Command18_Click Dim stDocName As String
stDocName = ChrW(25353) & ChrW(23398) & ChrW(29983) & ChrW(22995) & ChrW(21517) & ChrW(26597) DoCmd.RunMacro stDocName Exit_Command18_Click: Exit Sub
Err_Command18_Click:
MsgBox Err.Description
Resume Exit_Command18_Click End Sub
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click Dim stDocName As String
stDocName = ChrW(25353) & ChrW(-29698) & ChrW(31243) & ChrW(23398) & ChrW(20998) & ChrW(26597) DoCmd.RunMacro stDocName Exit_Command19_Click: Exit Sub
Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click End Sub
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click DoCmd.Close
Exit_Command20_Click: Exit Sub
Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click End Sub
Private Sub Command21_Click()
On Error GoTo Err_Command21_Click Dim stDocName As String
stDocName = ChrW(25353) & ChrW(-29698) & ChrW(31243) & ChrW(23398) & ChrW(20998) & ChrW(26597) DoCmd.RunMacro stDocName
Exit_Command21_Click: Exit Sub
Err_Command21_Click:
MsgBox Err.Description
Resume Exit_Command21_Click End Sub
Private Sub Command22_Click()
On Error GoTo Err_Command22_Click Dim stDocName As String
stDocName = ChrW(-29698) & ChrW(31243) & ChrW(21517) DoCmd.RunMacro stDocName Exit_Command22_Click: Exit Sub
Err_Command22_Click:
MsgBox Err.Description
Resume Exit_Command22_Click End Sub
Private Sub Form_Current() End Sub (7)学生信息现示
代码:Option Compare Database
Private Sub Form_Current() End Sub
(8)教学管理系统主菜单
代码:Option Compare Database
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.
' Move to the switchboard page that is marked as the default. Me.Filter = \默认' \ Me.FilterOn = True End Sub
Private Sub Form_Current()
' Update the caption and fill in the list of options. Me.Caption = Nz(Me![ItemText], \ FillOptions End Sub
Private Sub FillOptions()
' Fill in the options for this switchboard page. ' The number of buttons on the form. Const conNumButtons = 8
Dim con As Object Dim rs As Object Dim stSql As String
Dim intOption As Integer
' Set the focus to the first button on the form, ' and then hide all of the buttons on the form
' but the first. You can't hide the field with the focus. Me![Option1].SetFocus
For intOption = 2 To conNumButtons
Me(\
Me(\ Next intOption
' Open the table of Switchboard Items, and find ' the first item for this Switchboard Page.
Set con = Application.CurrentProject.Connection stSql = \
stSql = stSql & \Me![SwitchboardID]
stSql = stSql & \ Set rs = CreateObject(\ rs.Open stSql, con, 1 ' 1 = adOpenKeyset
' If there are no options for this Switchboard Page,
' display a message. Otherwise, fill the page with the items. If (rs.EOF) Then
Me![OptionLabel1].Caption = \此切换面板页上无项目。\ Else
While (Not (rs.EOF))
Me(\
Me(\ Me(\& rs![ItemNumber]).Caption = rs![ItemText] rs.MoveNext Wend End If
' Close the recordset and the database. rs.Close
Set rs = Nothing Set con = Nothing End Sub
Private Function HandleButtonClick(intBtn As Integer) ' This function is called when a button is clicked. ' intBtn indicates which button was clicked.
' Constants for the commands that can be executed. Const conCmdGotoSwitchboard = 1 Const conCmdOpenFormAdd = 2 Const conCmdOpenFormBrowse = 3