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!
***************
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!