This code has worked for a long time and I'm not sure what to fix, I've narrowed it down to be my numeric fields causing there error, but haven't found a way for the data to be inserted.
Here is the code:
Private Sub SaveInvoice()
'Write the records
Dim db As Database
Dim rst As Recordset
Dim NewInvNbr As Long
Set db = CurrentDb()
strCrit = "[inv_id] > 351372"
If IsNull(DLookup("inv_id", "inv_header", strCrit)) Then
NewInvNbr = 1
Else
NewInvNbr = DMax("inv_id", "inv_header", strCrit) + 1
End If
'Save the header info
selectstmt = "select * from inv_header"
Set rst = db.OpenRecordset(selectstmt, dbOpenDynaset)
rst.AddNew
rst("mbr_id") = Me.cmbMemberID
rst("inv_id") = NewInvNbr
rst("total") = Me.fldTotal
rst("cash") = Me.fldCash
rst("Change") = Me.fldChange
rst("cashtype") = Me.cmbPayType
rst("workstation") = "COMPUTERNAME"
rst("mbr_type") = DLookup("mbr_type", "members", "id = " + Str(Me.cmbMemberID.Value))
rst.Update
rst.Close
End Sub
Here is the setup of the table I'm trying to insert into:
Any help would be greatly appreciated!