nuable to update

W

wd1153

hi, all

I created a form with unbound fields. In Form_load event,
I write the codes as following:

Private Sub Form_Load()
Dim str As String
On Error GoTo Err_handler

Set rstPatient = New ADODB.Recordset
With rstPatient
.ActiveConnection = CurrentProject.Connection
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Source = "select * from tblPatients"
.Open
End With
Set Me.Recordset = rstPatient
Exit_here:
Exit Sub
Err_handler:
Resume Exit_here

End Sub

After I loaded the form, the form seems working fine with
all the data loaded. But, I could not update any data
through the form. I thought using adLockOptimistic and
adOpenDynamic would render the form undateable. Where is
the problem?
thanks a lot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top