Where did you get this syntax?
This looks like a mix of ADO and DAO
CurrentProject.Connection = ADO
Execute str = DAO.
That might be the problem.
As to the other issue, unless you know there will be a value in a field on your form, I would check for a value and supply one this way. It takes a little longer but is more robust code:
Dim str As String
Dim sType As String
Dim iWhom As Assuming
Dim iVendor As Integer 'assuming
Dim sSSN As String
If IsNull(Me.cboTransactionType) Or Me.cboTransactionType = "" Then
MsgBox "Please select a transaction type.", vbCritical
sType = Me.cboTransactionType
If IsNull(Me.cboPaymentToWhom) Then
MsgBox "Please select a recipient.", vbCritical
iWhom = Me.cboPaymentToWhom
str = "UPDATE tblTransaction SET TransactionType = '" & sType & "', " & _
"PaymentToWhom = " & iWhom & "', " & _
and so on to deposit amount.
The problem is, that your deposit amount field is probably numeric, and probably currency, so it would take a blank amount, it must take Zero. If it is an Access table, Access will supply the zero if you don't put in a record. You can set the Default Value of the field to be a blank value, and I think this will allow you to post "", or perhaps you do this:
If IsNull(Me.txtDepositAmount) Or Me.txtDepositAmount = "" Then
str = "... and skip the deposit amount field."
str = "... and add the deposit field."
If the field is numberic, it won't accept "", just 0. "" is a string data type, not a numeric data type. So modify your Update string to either have the value if it is some number, or skip it if it is empty, since Access won't care if you skip it unless the field is required. The default will be Null, I think, in that case.
Did that help?
Look it up at: http://wrox.books24x7.com