1、计算机二级 access vb部分(Computer two, access, VB)The 1. command button makes another command button work: CmdSave.Enabled =true2. click the button to display; Private, Sub, bt1_Click ()*Add*BTitle.Caption = tTest*Add*End Sub3, Private, Sub, Form_Load ()Set the form header to the current date*Add*Form.Capt
2、ion = Date*Add*End Sub4 10*Add1*If rs.RecordCount = 0 Then*Add1*MsgBox age data for non party employees“Sage = 0Exit SubElseSage = rs.Fields (0)End If*Add2*TAge = sage*Add2*Rs.CloseCn.CloseSet rs = NothingSet CN = Nothing11 sets are difficult, 18 sets are difficult, 25 are difficultK=inputbox (“,“ M
3、SG “) / opens. Show,DOCMD. openFORM/openREPORT “TEMP“ opens the table / ReportCase is=3 CASE 2 CASE 117 Private, Sub, btnP_Click ()Dim I As IntegerDim s As Integer*Add1*Dim f (19) As Integer*Add1*F (1) = 1:, f (2) = 1For I = 3, To 19*Add2*F (I) = f (I - 1) + F (I - 2)*Add2*Next Idata output to text
4、box*Add3*TData = f (19)*Add3*18 Private, Sub, bt1_Click ()dynamically setting forms to record source properties*Add1*Form.RecordSource = “qEmp“*Add1*Refresh the formMe.RequeryEnd SubPrivate, Sub, bt2_Click ()Close window*Add2*DoCmd.Close*Add2*End Sub19 Private, Sub, Form_Load ()Set the bTitle tab to
5、 red text display*Add1*“BTitle.ForeColor = vbRed*Add1*“End SubPreview outputPrivate, Sub, bt1_Click ()*Add2*“MdPnt (acViewPreview)*Add2*“End SubPrint outputPrivate, Sub, bt2_Click ()MdPnt acViewNormalEnd SubOutput processPrivate, Sub, mdPnt (flag, As, Integer)output in parameter conditionDoCmd.OpenR
6、eport “rEmp“, flagEnd Sub20) click the output button for previewPrivate, Sub, bt1_Click ()the message box prompts the report output (looks, style, see questions, dry legend)*Add*If MsgBox (report preview, vbYesNo + vbQuestion, confirmation) = vbYes Then*Add*Preview output report rEmpDoCmd.OpenReport
7、 “rEmp“, acViewPreviewEnd IfEnd Sub23 Mn ThenMn = IEnd IfEnd IfNext I* miss Add2the value of the prime number and the maximum prime number is displayed in the text box tData Me = tData = quantity: & n & Max: & MnPrivate, Sub, btnQ_Click ()code invokes macro object mEmp“* miss Add3DoCmd.RunMacro “mEmp“* miss Add3End SubPrivate, Sub, Form_Load ()set the title of the form to label bTitle * miss Add1Caption = bTitle.Caption* miss Add1End Sub39 Private, Sub, Form_Load ()Set the form background image*Add*Form.Picture = CurrentProject.Path & test.bmp“*Add*End Sub45 1 difficult