K
KPR
Hi,
I'd like to simply open a recordset, populate it with the records of a
table, set the RecordSource of my form to the RecordSet and then ensure that
any changes made in the form will never update my table. The code I'm using
is below but it still updates my table.
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = CurrentProject.AccessConnection
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "SELECT * FROM MyTable"
.LockType = adLockOptimistic
.CursorType = adOpenStatic
.CursorLocation = adUseServer
.Open
End With
'Set my form's Recordset property to the ADO recordset
Set Me.Recordset = rs
cn.Close
Set rs = Nothing
Set cn = Nothing
Any help would be apprecitated.
Thanks,
Ken
I'd like to simply open a recordset, populate it with the records of a
table, set the RecordSource of my form to the RecordSet and then ensure that
any changes made in the form will never update my table. The code I'm using
is below but it still updates my table.
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = CurrentProject.AccessConnection
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = "SELECT * FROM MyTable"
.LockType = adLockOptimistic
.CursorType = adOpenStatic
.CursorLocation = adUseServer
.Open
End With
'Set my form's Recordset property to the ADO recordset
Set Me.Recordset = rs
cn.Close
Set rs = Nothing
Set cn = Nothing
Any help would be apprecitated.
Thanks,
Ken