我一般把绑定写在click Private Sub cmbAccount_Click(Area As Integer) Select Case Area '双击后到设施 Case dbcAreaButton Dim sQuery As String sQuery = "select account from tblaccount " Set rstCmms = cnnCMMS.Execute(sQuery) Set cmbAccount.RowSource = rstCmms cmbAccount.ListField = "account" End Select End Sub
做数据库最好不要用绑定,而全部都由自己来做.我从来都是这样!
Private Sub cmbAccount_Click(Area As Integer)
Select Case Area '双击后到设施
Case dbcAreaButton
Dim sQuery As String
sQuery = "select account from tblaccount "
Set rstCmms = cnnCMMS.Execute(sQuery)
Set cmbAccount.RowSource = rstCmms
cmbAccount.ListField = "account" End Select
End Sub
不过做数据库程序最好不要用自动绑定,而自己来写程序,我从来都是这样做的.