按照例子做了一个模拟点击控件(Button4)的代码,但是到第3页会停止点击,手动点击(Button4)到第10页后又能模拟点击控件到最后一页,请蓝版看一下是哪出问题
With DataTables("信息比对")
If .LoadPage < .TotalPages - 1 Then
.LoadPage = .LoadPage + 1
.Load()
e.Form.Controls("TextBox2").Value = (.LoadPage + 1)
e.Form.Controls("TextBox1").Value = .TotalPages
End If
End With
筛选代码略
If e.Form.Controls("TextBox1").Value = e.Form.Controls("TextBox2").Value Then
MessageBox.show("比对完毕")
Return
Else
If e.Form.Controls("TextBox1").Value >= e.Form.Controls("TextBox2").Value Then
e.Form.Controls("Button4").PerformClick()
'MessageBox.show("比对完毕")
Return
End If
End If