S
Steven Scaife
My code is below it errors on the isnert into Payment_Merge line. I get
overflow error returned. I have tried opening the recordset without the
dbopenforward only and tried the insert statement with ' and without '
quotes around the values. I have also tried debugging.print the sql
statement when i had it as a string but got overflow error then. The values
i am inserting are number values and as far as i know numbers dont have the
single quotes. If any more information is needed please let me know, thanks
for any help
If cboPayMethod.Value = "Credit Card" Then
MsgBox "running the CCard Code"
strsql = "SELECT TOP 1 Payment_ID FROM Payment ORDER BY Payment_ID
DESC;"
Set rs = db.OpenRecordset(strsql, dbOpenForwardOnly)
db.Execute "INSERT INTO Payment_Merge (Payment_ID, Card_Number)
Values ('" & CInt(rs!Payment_ID) & "', '" & CInt(Me.txtCard) & "');",
dbFailOnError
strCardInfo = "INSERT INTO Card_Info (Card_Number, Card_Type, " _
& "Issue_Number, Expiry_Date) VALUES (" _
& CInt(Me.txtCard) & ", '" & Me.cboCardType & "', " &
CInt(Me.txtIssue) & ", '" & Me.txtExpiry & "');"
Debug.Print strCardInfo
MsgBox "Executing 2nd string"
db.Execute strCardInfo, dbFailOnError
Else
MsgBox "CCard code not run"
End If
overflow error returned. I have tried opening the recordset without the
dbopenforward only and tried the insert statement with ' and without '
quotes around the values. I have also tried debugging.print the sql
statement when i had it as a string but got overflow error then. The values
i am inserting are number values and as far as i know numbers dont have the
single quotes. If any more information is needed please let me know, thanks
for any help
If cboPayMethod.Value = "Credit Card" Then
MsgBox "running the CCard Code"
strsql = "SELECT TOP 1 Payment_ID FROM Payment ORDER BY Payment_ID
DESC;"
Set rs = db.OpenRecordset(strsql, dbOpenForwardOnly)
db.Execute "INSERT INTO Payment_Merge (Payment_ID, Card_Number)
Values ('" & CInt(rs!Payment_ID) & "', '" & CInt(Me.txtCard) & "');",
dbFailOnError
strCardInfo = "INSERT INTO Card_Info (Card_Number, Card_Type, " _
& "Issue_Number, Expiry_Date) VALUES (" _
& CInt(Me.txtCard) & ", '" & Me.cboCardType & "', " &
CInt(Me.txtIssue) & ", '" & Me.txtExpiry & "');"
Debug.Print strCardInfo
MsgBox "Executing 2nd string"
db.Execute strCardInfo, dbFailOnError
Else
MsgBox "CCard code not run"
End If