Solved

The Field is too small to accept amount of data

Posted on 2004-10-13
7
275 Views
Last Modified: 2006-11-17
I have an Access97 frontend with an SQL backend. The following code generates the error "The Field is too small to accept amount of data try...." Why? I am not adding or inserting. I am just searching. Why?


Dim db As Database
Dim StrCriteria  As String
Dim CustomersRS As Recordset

        Set db = CurrentDb()
        Set CustomersRS = db.OpenRecordset("Customers", dbOpenDynaset)
        StrCriteria = "[ReminderDate] = #1/1/04#"
        CustomersRS.FindFirst StrCriteria

Thanks, Ira
0
Comment
Question by:QuickQuote
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 9

Expert Comment

by:paelo
ID: 12304788
SQL does use different delimiters for date values but I can never remember how Access handles them, especially Acc97.  Try using "[ReminderDate]='1/1/04'.  You also might want to consider moving to the ADO recordset object rather than DAO when working with SQL server.

-Paul.
0
 

Author Comment

by:QuickQuote
ID: 12304834
Tried that too. Same error. It's just a find. Why the error?
0
 
LVL 9

Expert Comment

by:paelo
ID: 12305065
I'm not familiar with the particular error, but maybe its an old bug with the DAO library.  You could try to check your references and update to the DAO 3.6 library if possible.  
0
 
LVL 3

Accepted Solution

by:
StuartSanders earned 500 total points
ID: 12307652
You could try using the numerical value

StrCriteria = "[ReminderDate] = " & cstr(clng(datevalue("1/1/04")))

or alternatively open the recordset with the critieria

        Set db = CurrentDb()
        StrCriteria = "[ReminderDate] = #1/1/04#"
        Set CustomersRS = db.OpenRecordset("SELECT Customers.* FROM Customers WHERE " & StrCriteria, dbOpenDynaset)

        if not CustomersRS.eof then
       ' do stuff
             
Stuart
0
 

Author Comment

by:QuickQuote
ID: 12307653
Just tried the new 3.6 library...same error.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question