my recordset won't update

G

Guest

here's my code
***************
Sub ClientsRecordset()

Dim cnCurrent As ADODB.Connection
Dim rsClients As ADODB.Recordset

Set cnCurrent = CurrentProject.Connection
Set rsClients = New ADODB.Recordset

rsClients.Open "Clients", cnCurrent, adOpenDynamic, adLockOptimistic,
adCmdTable

rsClients!ClientNumber = ClientCode(Form_frmAllClients.FirstName.Value,
Form_frmAllClients.LastName.Value, Form_frmAllClients.AdmitDate.Value,
Form_frmAllClients.VisitNUmber.Value)
rsClients.Update
End Sub

(ClientCode is a custom function that is working properly)
***********
when I step thruthe code, the value stored in
rsClients!ClientNumber="CorrectValue" and the rs.Update doesn't cause an
error; however, nothing gets updated!

Originally, I tried it another way, by setting strSQL and then cn.Execute
strSQL, and it did work on ALL records. Fine, so I added the WHERE ClientID
= txtOnForm.Value BUT my ClientID is a number and I got a datatype mismatch.


thanks for any help!
 

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