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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The field is too small to accept the amount of data you attempted to.. 1

Status
Not open for further replies.

commatom

Programmer
Aug 30, 2007
54
US
I am looking at an old Access App and am way in over my head

I am getting the error
The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.


When I look at the module I see there is a report trying to open which calls a query. When I try to open the report, nothing happens. When I try to open the query, it opens but there is no data.

I am really lost here. Any suggestions?

Here is the code for the module....

Private Sub CmdPrintInterim_Click()

On Error GoTo Err_CmdPrintInterim_Click

Dim x As Integer
Dim objcls As clsRecordedPayments

Set objcls = New clsRecordedPayments
objcls.ReprintUrgencies x, True
ReportType = 1
If x > 0 Then
DoCmd.OpenReport "rptUrgency", acViewNormal, , "Processed = False"
Else
MsgBox "There are no Payments to Process."
End If
Me!SumOfAmount = DSum("Amount", "tblUrgencyProcessing")
Me!CountOfPayments = DCount("AuthNumber", "tblUrgencyProcessing")

Exit_CmdPrintInterim_Click:
Exit Sub
Err_CmdPrintInterim_Click:
MsgBox Err.Description
Resume Exit_CmdPrintInterim_Click

End Sub
 
When the error pops up, hit ctl+brk. Click on "debug".
Post back the code that is highlighted in yellow.

Illegitimi non carborundum.
 
Thanks, thats going to be a big help now that I know I cant do that

All it says though is:
Resume Exit_LoadDailyProcessing


The exit_loaddailyprocessing is like so:

Exit_LoadDailyProcessing:
If Interim Then
PaymentConn.Execute "Update AutoPay Set BatchDate = Null Where BatchDate = '" & varBatchNo & "'", , adCmdText
PaymentConn.Execute "Update ChargePayments Set BatchDate = Null Where BatchDate = '" & varBatchNo & "'", , adCmdText
End If
Set rs1 = Nothing
Set rs2 = Nothing
Set LocalConn = Nothing
Set PaymentConn = Nothing
Exit Sub
Err_LoadDailyProcessing:
MsgBox Err.Description
Resume Exit_LoadDailyProcessing
 
One more thing to add.

I know its not updating two tables in SQL Server that it is hitting in the above code, so the error is happening before that.
 
OK, then at the first executable line of code in the procedure, add a breakpoint by clicking in the margin to the left of the line of code. A brown dot should appear. Now, execute the code (run the app). The code will stop where you added the breakpoint. You can walk through the code 1 line at a time by clicking on the debug menu, then on "Step Into".
You can also customize your toolbar with this button which makes it easier, but that's another discussion. As you step through each line of code, you can hover the cursor over a variable & see its contents. Sooner or later, you will find the error as you step through the code line-by-line. When you do, post back if you are still having trouble. Also, do a help lookup on "Immediate Window", and "Debug".
Good Luck!

Illegitimi non carborundum.
 
Forget that last statement, It sets the batchdate back to null on the exception handling. Sorry for the confusion.
 
Thanks so much for the help. I knew it was something simple but I am not an Access guy or VB.

Basically what happened was about 5 called sub routines deep, there was a column for city which was set to 20 characters. Well Hot Springs National Park didn't fit.

THANKS AGAIN....BIG STAR FOR YOU!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top