Hi, I am experimenting with ADO *trying to figure it all out* and I work in Access 2000. I would like to know how do I bind my Access form to ADO. Here is some code I wrote to get a handle on what is happening it finds one record which is what I want it to do but my form still list all the records. What I want to do is allow the underlying form show just the one filtered record.
Dim rst(1 To 2) As ADODB.Recordset
Dim cnn As ADODB.Connection
'* this is the record we are working on
Set rst(1) = New ADODB.Recordset
Set cnn = CurrentProject.Connection
'* the recordset and collection we want to work on
'* it has to be open like this.
rst(1).Open "SELECT * from qrynames", cnn, adOpenStatic, adLockReadOnly
'*requery the database to get our records in order
Me.Requery
If cnn.State = adStateOpen Then
MsgBox "You got a good connection."
'Debug.Print Cnn.ConnectionString
End If
'* create a recordclone here
Set rst(2) = rst(1).Clone
Dim strFilter As String
strFilter = Me("CustID"
Debug.Print strFilter
With rst(2)
.Filter = "custid = " & strFilter
If Not .EOF Then
MsgBox "We are working with our clone."
MsgBox "You have " & rst(2).RecordCount & " records in your clone"
End If
End With
Any guidance is truly appreciated Life's a journey enjoy the ride...
jazzz
Dim rst(1 To 2) As ADODB.Recordset
Dim cnn As ADODB.Connection
'* this is the record we are working on
Set rst(1) = New ADODB.Recordset
Set cnn = CurrentProject.Connection
'* the recordset and collection we want to work on
'* it has to be open like this.
rst(1).Open "SELECT * from qrynames", cnn, adOpenStatic, adLockReadOnly
'*requery the database to get our records in order
Me.Requery
If cnn.State = adStateOpen Then
MsgBox "You got a good connection."
'Debug.Print Cnn.ConnectionString
End If
'* create a recordclone here
Set rst(2) = rst(1).Clone
Dim strFilter As String
strFilter = Me("CustID"
Debug.Print strFilter
With rst(2)
.Filter = "custid = " & strFilter
If Not .EOF Then
MsgBox "We are working with our clone."
MsgBox "You have " & rst(2).RecordCount & " records in your clone"
End If
End With
Any guidance is truly appreciated Life's a journey enjoy the ride...
jazzz