哈,看来还是求人不如求已,问题已通过编程,变通解决了!
方法如下:
先建一个带数据表查询的表格窗体(查询数据已按身份证号排序),然后,再在其表格窗体的页眉上,建一个命令按钮,
其代码内容为:
Private Sub 命令4_Click()
Dim ZH0, XM0 As String
Dim Check As Boolean
Check = True
DoCmd.GoToRecord , , acFirst
Do While Me.Recordset.RecordCount > Me.CurrentRecord
ZH0 = [帐号]
XM0 = [姓名]
DoCmd.GoToRecord , , acNext
Do While [帐号] = ZH0
If [姓名] = XM0 Then
DoCmd.GoToRecord , , acNext
Else
Check = False
Exit Do
End If
Loop
If Check = False Then
Exit Do
End If
Loop
If Check = False Then
MsgBox "出现同帐号且不同姓名的记录,请更正之!", , "出 错 了"
Else
DoCmd.GoToRecord , , acLast
MsgBox "未有同帐号且不同姓名的记录,检查通过!", , "恭 喜 了"
End If
End Sub
反复执行该命令,直到通过检查为止!