I am trying to put values into a table and having trouble with one specific value. I am using the following code:
Dim dblInvoices As Double
dblInvoices = CDbl(TotInvoice)
strFile = Me.File
Set db = CurrentDb
Set rs = db.OpenRecordset("tbl1", dbOpenDynaset)
rs.FindFirst "File = '" & strFile & "'"
rs.Edit
rs!TotInvoices = dblInvoices
rs.Update
rs.Close
The control, TotInvoice, on the form is unbound but the data I put into it when the form becomes current is is a string for example "3". When I run the code above all the fields are updated (I update more but didn't include those here) except the rs!TotInvoices field. It just changes to its default value of 0 regardless of what I try to put into it.
I just tried commenting out the rs!TotInvoices = dblInvoices and the value was still changed from 1 to its default of 0.
I am lost. Help.
Eddy
Dim dblInvoices As Double
dblInvoices = CDbl(TotInvoice)
strFile = Me.File
Set db = CurrentDb
Set rs = db.OpenRecordset("tbl1", dbOpenDynaset)
rs.FindFirst "File = '" & strFile & "'"
rs.Edit
rs!TotInvoices = dblInvoices
rs.Update
rs.Close
The control, TotInvoice, on the form is unbound but the data I put into it when the form becomes current is is a string for example "3". When I run the code above all the fields are updated (I update more but didn't include those here) except the rs!TotInvoices field. It just changes to its default value of 0 regardless of what I try to put into it.
I just tried commenting out the rs!TotInvoices = dblInvoices and the value was still changed from 1 to its default of 0.
I am lost. Help.
Eddy