基于Access 2003数据库开发设计的教学管理系统-大学毕业论文毕业设计学位论文范文

2026/1/23 19:08:59

代码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 Const conCmdOpenReport = 4

Const conCmdCustomizeSwitchboard = 5 Const conCmdExitApplication = 6

Const conCmdRunMacro = 7 Const conCmdRunCode = 8 Const conCmdOpenPage = 9

' An error that is special cased. Const conErrDoCmdCancelled = 2501

Dim con As Object Dim rs As Object Dim stSql As String

On Error GoTo HandleButtonClick_Err

' Find the item in the Switchboard Items table

' that corresponds to the button that was clicked. Set con = Application.CurrentProject.Connection Set rs = CreateObject(\

stSql = \

stSql = stSql & \[SwitchboardID]=\& Me![SwitchboardID] & \AND [ItemNumber]=\

rs.Open stSql, con, 1 ' 1 = adOpenKeyset

' If no item matches, report the error and exit the function. If (rs.EOF) Then

MsgBox \读取 Switchboard Items 表时出错。\ rs.Close

Set rs = Nothing Set con = Nothing Exit Function End If

Select Case rs![Command]

' Go to another switchboard. Case conCmdGotoSwitchboard

Me.Filter = \= 0 AND [SwitchboardID]=\& rs![Argument]

' Open a form in Add mode. Case conCmdOpenFormAdd

DoCmd.OpenForm rs![Argument], , , , acAdd

' Open a form.

Case conCmdOpenFormBrowse


基于Access 2003数据库开发设计的教学管理系统-大学毕业论文毕业设计学位论文.doc 将本文的Word文档下载到电脑
搜索更多关于: 基于Access 2003数据库开发设计的教学管理系统-大学 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219