Hi Guys
I have inherited an Access DB in a very poorly state! I have offered to make some changes to it for a local charity but have got stuck on this error it seems to be creating for all new records.
I am working within a Form which is calling another Form matched on the ID, this is within Access 2000. Clicking the cmdLinkExisting CaredFor_Click produces an Error 6: Overflow error.
Can anyone help me as to what maybe making the code fall down? - Private Sub cmdLinkExistingCaredFor_Click()
-
On Error GoTo Err_cmdLinkExistingCaredFor_Click
-
-
Set dbs = CurrentDb
-
Set rst = dbs.OpenRecordset("SELECT * FROM tblPeople " & _
-
"WHERE tblPeople.PersonType = 'Cared For' OR tblPeople.PersonType = 'Both' ")
-
If rst.RecordCount > 0 Then
-
Me.Tag = Me.CurrentRecord
-
stLinkCriteria = "[CarerID]= " & Me.PersonID
-
stDocName = "frmExistingCaredForByCarer"
-
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.txtForeName & " " & Me.txtFamilyName
-
Else
-
MsgBox "There are NO 'Cared Fors' in the database."
-
End If
-
-
Exit_cmdLinkExistingCaredFor_Click:
-
Exit Sub
-
-
Err_cmdLinkExistingCaredFor_Click:
-
Call LogError(Err.Number, Err.Description, Me.Name, "cmdLinkExistingCaredFor_Click")
-
Resume Exit_cmdLinkExistingCaredFor_Click
-
-
End Sub
Any help would be much appreciated - was just trying to do someone a favour but got in a little over my head!!!
2 2594 FishVal 2,653
Recognized Expert Specialist
Hi, Angie.
First localize faulty code.
Comment out
On Error GoTo Err_cmdLinkExis tingCaredFor_Cl ick
line and see where code execution stops.
nico5038 3,080
Recognized Expert Specialist
Also add a test after the SET of rst or record(s) have been found like: -
Set rst = dbs.OpenRecordset("SELECT ....
-
IF rst.EOF and rst.BOF then
-
' the action when there's no record found with e.g. a msgbox and an exit
-
endif
-
To have a correct recordcount you would also need to use:
before testing the recordcount.
Nic;o)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jeff |
last post by:
Dim lngWeights as long, lngBuckets as Long
Const STDWEIGHTS = 12
lngBuckets = 1000
lngWeights = lngBuckets * STDWEIGHTS
This causes an Overflow error. For lower values it works. Obviously the
result of 36000 is more than an Integer can take, but not a Long?? Yes, I
did double-check my code.
|
by: MLH |
last post by:
?2944*24
gives me an overflow error, entered in the
immediate window. Anybody else?
|
by: Chua Wen Ching |
last post by:
Thanks Derek...
Okay i had another question..
my program runs smoothly for the first minute, after 1
minute...
suddenly it breaks and display this error:
do you know what is the cause of this problem...
|
by: rollasoc |
last post by:
Hi,
Made me laugh so I though I'd share this.
short i = 32;
short j = 1;
short k = i + j;
gives an error
Cannot implicitly convert type 'int' to 'short'
|
by: zaneh |
last post by:
I have found TheScripts a very useful site, but however I cannot find an answer to a problem I am having, so I finally have to ask the question!
I am getting an Overflow error in a Function I have written.
BUT... It does not occur all the time.
If I call the Function from the "After Update" event for a checkbox, it works as intended, how ever if I call the Function from the "On Load" event of the Form, testing to see whether the...
| |
by: nancyisbell |
last post by:
I used the following test01.xml file below to exercise the
cnlUnit01.xslt.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="cnlUnit01.xslt"?>
<cnlUnitXsl unitDataFile="111111"/>
The cnlUnit01.xslt file below should recursively concatenate the
string "Level", the string " ", and the numeric value of the number
(level) of recursions that occur, and print that 10073 times in
|
by: MLH |
last post by:
A wide comma delimited text file import into A97 failed
with an overflow error. I'm estimating it to have been
no more than 1000 records. 100% of all the fields were
quoted strings or ZLS's.
What most likely caused the overflow?
Might it be upper limit on number of fields in table?
|
by: mike3 |
last post by:
Hi.
Is this a good idea?:
<begin code>
/* Addition operator: += */
const BigFix &BigFix::operator+=(const BigFix &rhs)
{
ErrorType err;
int lhs_sign = sign, rhs_sign = rhs.sign;
|
by: jer006 |
last post by:
Hi I am writing a select statement that has an arithmetic function
inside a case statement that uses logic to decide whether to divide or
multiply and when I run the arithmetic statements outside the case
statement they work fine, but blow up with an overflow error in the
case statement. The select looks like:
SELECT a.acct_cd,
a.crrncy_cd,
a.mkt_val,
c.rate,
|
by: mike3 |
last post by:
Hi.
(crossposted because the program is in C++ and some C++-related
elements are discussed, hence comp.lang.c++, plus general program
design questions are asked, hence comp.programming.)
I'm making this bignum package in C++. I'm wondering though on how to
handle the errors. Right now most operations routines return error
codes if they fail -- but some routines they use inside them, or
overloaded operators, will throw exceptions on...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |