pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
Hi, I'm trying to open recordset with data and then edit it and it error. where 'm i doing wrong. Do i need to open differently?
Thanks in advance.
Thanks in advance.
Code:
[/FONT]
[FONT=Courier New]Option Compare Database[/FONT]
[FONT=Courier New]Sub dfgsdfhdcvbxcv()
Dim cnn As ADODB.Connection
Set cnn = CurrentProject.Connection
Dim MyRecordset As New ADODB.Recordset[/FONT]
[FONT=Courier New]MyRecordset.ActiveConnection = cnn
Dim MySQL As String[/FONT]
[FONT=Courier New]MySQL = "Select * FROM JOBS WHERE JOBS =" & "'XJOB11'"[/FONT]
[FONT=Courier New]MyRecordset.Open MySQL
While Not MyRecordset.EOF
Debug.Print MyRecordset!JOBS
[COLOR=blue] MyRecordset.Edit[/COLOR]
MyRecordset!CLINTID = 7
MyRecordset.Update
MyRecordset.MoveNext
Wend[/FONT]
[FONT=Courier New]MyRecordset.Close
Set MyRecordset = Nothing[/FONT]
[FONT=Courier New]End Sub