this is my code, but if I use date, numbers, or currency I will get
the same error:
Private Sub Create_invoices_Click()
On Error GoTo Err_Create_invoices_Click
Dim dbsSP As Database
Dim pts As DAO.Recordset
Dim dtDate As Date
Set dbsSP = CurrentDb()
Set pts = dbsSP.OpenRecordset("Payments", dbOpenDynaset)
'get the information that is needed
dtDate = Me![StartDate]
'prodeed only if the user actually intered somthing
If dtDate <> "" Then
'calls the funchion that adds the record
addRec pts, dtDate
'shows the newly added data.
With pts
Debug.Print "new record added"
End With
Else
Debug.Print _
"you must input a string for monthly payment and
payment ID" End If
pts.Close
dbsSP.Close
Exit_Create_invoices_Click:
Exit Sub
Err_Create_invoices_Click:
MsgBox Err.Description
Resume Exit_Create_invoices_Click
End Sub
Function addRec(rstTemp As Recordset, dt As Date)
With rstTemp
.AddNew
!StartingDate = dt
.Update
.Bookmark = .LastModified
End With
End Function