form1
Private Sub Command1_Click()
vb_msg = MsgBox("请输入", vbOKCancel)
If vb_msg = vbCancel Then
Exit Sub
End If
Data1.Recordset.AddNew
Data1.Recordset.Fields("姓名") = Text1.Text
Data1.Recordset.Fields("") = Text2.Text
Data1.Recordset.Fields("QQ") = Text3.Text
Data1.Recordset.Fields("家庭住址") = Text4.Text
Data1.Recordset.Fields("现就读学校") = Text5.Text
Data1.Recordset.Fields("何时的同学") = Text6.Text
End Sub
Private Sub Command2_Click()
Dim areturn As Integer
areturn = MsgBox("你确实要删除该记录吗?", vbYesNo)
If areturn = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End If
End Sub
Private Sub Command3_Click()
msg = InputBox("请输入姓名", "查记录")
Data1.Recordset.FindFirst "姓名='" & msg & "'"
If Data1.Recordset.NoMatch Then
MsgBox "没有符合条件的人名"
Else
MsgBox "符合条件的人名为" & Data1.Recordset.Fields(0)
End If
End Sub
Private Sub Command4_Click()
Dim areturn As Integer
areturn = MsgBox("你确实要修改记录吗?", vbyueno)vb所有代码
If areturn = vbYes Then
Data1.Recordset.Edit
Data1.Recordset.Fields("姓名") = Text1.Text
Data1.Recordset.Fields("") = Text2.Text
Data1.Recordset.Fields("QQ") = Text3.Text
Data1.Recordset.Fields("家庭住址") = Text4.Text
Data1.Recordset.Fields("现就读学校") = Text5.Text
Data1.Recordset.Fields("何时的同学") = Text6.Text
End If
End Sub
Private Sub Command5_Click()
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF Then
Data1.Recordset.MoveFirst
MsgBox ("已经是第一条记录了!")
End If
End Sub
Private Sub Command6_Click()
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
MsgBox ("已经是最后一条记录了!")
End If
End Sub
Private Sub Command7_Click()
End
End Sub
Private Sub form_load()
Form1.Hide
Form2.Show
End Sub
form2
Private Sub Command1_Click()
If Text1.Text = "应小霞" And Text2.Text = "yxx" Then
MsgBox ("登陆成功!")
Form1.Show
Form2.Hide
Else
MsgBox ("用户名或密码错误!请重新输入!")
Text1.Text = ""
Text2.Text = ""
Form1.Hide
Form2.Show
End If
End Sub
Private Sub Command2_Click()
End
End Sub
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论