Data Type Missmatch in Criteria Expression - VB [Update] Statement
Posted on 2007-03-27
I've got this piece of code built in my database. It is supposed to update a field in the DecisionData table, but I'm getting a Data Type Mismatch error. From what I can tell, all of the data types match, but Access is disagreeing.
Variable AD is a boolean in the code. I assign it to True. In the table the field tblAccDec is set to Yes/No type.
Variable INQN comes from a form. The data type in the form is set to General Number. The number comes from another piece of code that uses a data type of Variant. In the table, the field InquiryNumber is set to type Number. I must be missing something. Any info or ideas that anyone has would be greatly apprecieated. Thanks.
Public Sub PreAppAcceptancebtn_Click()
Dim AD As Boolean
Dim INQN As Variant
AD = True
INQN = Forms!VisaOnDemand!frmInquiryNumber
CurrentDb.Execute "UPDATE [DecisionData] SET tblAccDec = '" & AD & "' WHERE InquiryNumber = '" & Forms!VisaOnDemand!frmInquiryNumber & "'"
CurrentDb.Execute "UPDATE [DecisionData] SET tblAccAmt = '" & frmAccAmount & "' WHERE InquiryNumber = '" & Forms!VisaOnDemand!frmInquiryNumber & "'"