这个是我现在做的毕业设计的一部分,给你看看吧!~ Public du As ADODB.Recordset Private Sub Command1_Click(Index As Integer) Select Case Index Case 0 du.MoveFirst play Case 1 du.MovePrevious If du.BOF = True Then du.MoveFirst End If play Case 2 du.MoveNext If du.EOF = True Then du.MoveLast End If play Case 3 du.MoveLast play Case 4 客户查找.Show Case 5 Unload Me End Select Label11.Caption = "现在是第" & Str(Val(du.Fields(1))) & " 个客户" End Sub
Private Sub Form_Load() Set du = New ADODB.Recordset string1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\数据\客户信息.mdb;Persist Security Info=False" du.CursorType = adOpenStatic du.Open "客户", string1, , , adCmdTable play Label10.Caption = "共有 " & du.RecordCount & " 名客户" Label11.Caption = "现在是第 1 个客户" End Sub
Public Sub play() Text1.Text = du.Fields("客户编号") Text2.Text = du.Fields("客户姓名") Text3.Text = du.Fields("身份证") Text4.Text = du.Fields("通信地址") Text5.Text = du.Fields("联系方式") Text6.Text = du.Fields("入会时间") Text7.Text = du.Fields("邮政编码") If du.Fields("会员") = True Then Check1.Value = 1 Else Check1.Value = 0 End If If du.Fields("交会费") Then Check2.Value = 1 Else Check2.Value = 0 End If End Sub
Private Sub Option1_Click() If Option1.Value = True Then Label1.Caption = "请输入客户编号" End If End Sub
Private Sub Option2_Click() If Option2.Value = True Then Label1.Caption = "请输入客户姓名" End If End Sub