C
chancellor
Guest
I have the following code:
Dim rec As ADODB.Recordset
objword.Visible = True
Set rec = New ADODB.Recordset
rec.CursorType = 2
rec.LockType = 3
rec.CursorLocation = adUseClient
If ((tu1 = 2) Or (tu1) = 4) Then
With rec
.AddNew
.Fields("physician") = "fffff"
.Update
End With
End If
Unfortunately, the addnew command does not appear to be working. I'm trying to add "ffff" to the recordset already created elsewhere. However, this code replaces the first record in the recordset with "ffff". It does not add it to the recordset already in place. I've tried moving to the end of the recordset and adding but that does not appear to work either. Does anyone know which combination of cursor locations, lock types and cursortypes will allow me to add "ffff" to a recordset based on whether another variable has a certain value?
This truly has me stumped.
Dim rec As ADODB.Recordset
objword.Visible = True
Set rec = New ADODB.Recordset
rec.CursorType = 2
rec.LockType = 3
rec.CursorLocation = adUseClient
If ((tu1 = 2) Or (tu1) = 4) Then
With rec
.AddNew
.Fields("physician") = "fffff"
.Update
End With
End If
Unfortunately, the addnew command does not appear to be working. I'm trying to add "ffff" to the recordset already created elsewhere. However, this code replaces the first record in the recordset with "ffff". It does not add it to the recordset already in place. I've tried moving to the end of the recordset and adding but that does not appear to work either. Does anyone know which combination of cursor locations, lock types and cursortypes will allow me to add "ffff" to a recordset based on whether another variable has a certain value?
This truly has me stumped.