Solved

The Field is too small to accept amount of data

Posted on 2004-10-13
7
234 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
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now