Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code not writing record to table

Status
Not open for further replies.

JoanieB

Programmer
Apr 17, 2001
57
US
IT'S BEEN WORKING FOR THE PAST MONTH! In a docmd statement to insert records into a table: I have been walking through the code step by step - the program executes the line of code to insert record {with NO error messages and no break in code execution}, but the record just isn't written to the table.
Any suggestions?
 
Hi!

Could you post the event procedure? Maybe we can help if we looked at the code.

Jeff Bridgham
 
'I first set recordset, variables, etc
DoCmd.RunSQL "INSERT INTO TblFinalTotals (DetailDesc,_ Cusip, BBHNum, SecDesc, Datedetected, pledged, unpledged,_ firminv, transfer, breakdetail, usdamt) VALUES (" & "'" &_ DetailDesc & "','" & CUSIP & "','" & BBHNUM & "','" & _ SECDESC & "','" & Date1 & "','" & PLEDGED & "','" & _ UNPLEDGED & "','" & FirmInv & "','" & TRANSFER & "','" & _ BreakTotal & "','" & USDAmt & "');"
DetailDesc = "DETAIL"
BadCharacter = "'"
Select Case BreakDesc1
Case ""
BreakDesc1 = "Other"
If Comment1 = "" Then
Comment1 = "None"
Call ExtractCharacter(Contact1, BadCharacter)
DoCmd.RunSQL "INSERT INTO TblFinalTotals _(detaildesc, secdesc, BreakDetail, datedetected, age, _ BreakDesc, comment, dept, contact, bbhnum, cusip) VALUES _("& "'" & DetailDesc & "','" & SECDESC & "','" & _ BreakDetail1 & "','" & Date1 & "','" & Age1 & "','" & _ BreakDesc1 & "','" & Comment1 & "','" & Dept1 & "','" & _ Contact1 & "','" & BBHNUM & "','" & CUSIP & "');"
Else
etc.

*It writes the first record to the table, goes through the "if", gets to the second insert statement, passes through [with no problems or errors] and just never writes the record to the table. Like I said, it's been working fine until today?
 
NEVERMIND!!!!! I figured it out. One variable was null value, I must have missed it and not encountered the problem before. So thanks anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top