473,383 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

RunTime Error 5

Is there a reason why i keep getting this run time error, i never
gotten it before. Can someone help me out with this? here is my code:

With rstout
'first check if not on EOF
If Not (rstin.EOF) Then
rstin.MoveFirst
'loop through all the records rstIN (table tblPhongParseIN)
Do While Not rstin.EOF
'set strField1 to tblPhongParseIN Field1
strField1 = rstin("ID")
cutstring = Left([strField1], InStr([strField1], " ") -
1)<------This is where i get the error.
strfield4 = rstin("amt_issued")

THank you.

Nov 13 '05 #1
10 9851
ph*******@gmail.com wrote:
Is there a reason why i keep getting this run time error, i never
gotten it before. Can someone help me out with this? here is my code:

With rstout
'first check if not on EOF
If Not (rstin.EOF) Then
rstin.MoveFirst
'loop through all the records rstIN (table tblPhongParseIN)
Do While Not rstin.EOF
'set strField1 to tblPhongParseIN Field1
strField1 = rstin("ID")
cutstring = Left([strField1], InStr([strField1], " ") -
1)<------This is where i get the error.
strfield4 = rstin("amt_issued")

THank you.


Phong,

When I try MsgBox (Left("My Text", -1)), I get error message 5. That
seems to suggest that " " is not being found in [strField1] causing a
-1 to show up in the Length argument. Also, assuming strField1 is
declared to be a string, there shouldn't be any square brackets around
it. Maybe Access is looking for Me.strField1 because of the square
brackets. Anyway, MsgBox("*" & strField1 & "*") to see if it contains
a blank or not. I also don't see why you need to require a " " in an
'ID' field. Perhaps use an If..Then..Else on whether or not
InStr(strField1, " ") = 0.

James A. Fortune

Nov 13 '05 #2
Thanks for the reply. i'm just trying to parse this string into
fields.

i have a field that looks like this

Field 1
12345678 MASS
Field 2
;2;3;3;5;08/01/2014;3;100.0000;2;1395000.00;5;08/01/2015;3;100.0000;2;1475000.00;5;08/01/2016;3;100.0000;2;1555000.00;

i'm just trying to parse field one without the MASS section, and the
second field i was trying to parse out everything except for the DATE
and the PRICE field. Please advise.

Nov 13 '05 #3
sometime field one has more then 9 characters long. So i guess i'm
just looking for a better to parse field one without it bombing.
thanks.

Nov 13 '05 #4

ph*******@gmail.com wrote:
Thanks for the reply. i'm just trying to parse this string into
fields.

i have a field that looks like this

Field 1
12345678 MASS
Field 2
;2;3;3;5;08/01/2014;3;100.0000;2;1395000.00;5;08/01/2015;3;100.0000;2;1475000.00;5;08/01/2016;3;100.0000;2;1555000.00;

i'm just trying to parse field one without the MASS section, and the
second field i was trying to parse out everything except for the DATE
and the PRICE field. Please advise.


If you are using Access 2000 or higher, you can use the split function
to parse the strings. Does Field 1 always contain a space? I don't
know what the split function will do to ";2;3..." when using ";" as a
delimiter. You'll have to try it.

James A. Fortune

Nov 13 '05 #5
Field 1 always has a space. i'm able to parse field 2. it's just i
don't understand why field 1 doesn't work.

Nov 13 '05 #6
ph*******@gmail.com wrote:
Field 1 always has a space. i'm able to parse field 2. it's just i
don't understand why field 1 doesn't work.


After checking out:

http://groups-beta.google.com/group/...50f165ea?hl=en

Grab the space character and examine its asc() value to be sure it's a
normal space character.

James A. Fortune

Nov 13 '05 #7
What's cutstring declared as? Is it possibly a numeric variable by mistake?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

<ph*******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Is there a reason why i keep getting this run time error, i never
gotten it before. Can someone help me out with this? here is my code:

With rstout
'first check if not on EOF
If Not (rstin.EOF) Then
rstin.MoveFirst
'loop through all the records rstIN (table tblPhongParseIN)
Do While Not rstin.EOF
'set strField1 to tblPhongParseIN Field1
strField1 = rstin("ID")
cutstring = Left([strField1], InStr([strField1], " ") -
1)<------This is where i get the error.
strfield4 = rstin("amt_issued")

THank you.

Nov 13 '05 #8
I got it to work. i had to change some query that was bringing my data
into the table. So i'm getting a runtime error 6 stating an overflow?
i do not know how that error is coming up and why. can someone adivse
on that? thank you.

Nov 13 '05 #9
I got it to work. i had to change some query that was bringing my data
into the table. So i'm getting a runtime error 6 stating an overflow?
i do not know how that error is coming up and why. can someone adivse
on that? thank you.

Nov 13 '05 #10

ph*******@gmail.com wrote:
I got it to work. i had to change some query that was bringing my data
into the table. So i'm getting a runtime error 6 stating an overflow?
i do not know how that error is coming up and why. can someone adivse
on that? thank you.


If the value is an integer, use Long as the field's data type. If not,
try the Double data type.

James A. Fortune

Nov 13 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bob Bamberg | last post by:
Hello All, I have been trying without luck to get some information on debugging the Runtime Error R6025 - Pure Virtual Function Call. I am working in C++ and have only one class that is derived...
5
by: Nathan Bloom | last post by:
Hi, I have a secured database that runs fine on the computer the database is installed on. I have several workstations with access runtime installed that also need access to the database. ...
2
by: Paul | last post by:
I'm hoping someone can help me with the problem. I have a database where the default value for a date field in a table is =date() This works perfectly in my table and on my form. But when I...
12
by: Markus Ewald | last post by:
I'm just experimenting around with the VisualC++ 2005 Express Edition Beta and found some strange behavior for which I can't seem to find a workaround. What I've done is set up two static library...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
0
by: zfraile | last post by:
I'm getting this error from the JIT compiler at runtime, but only on my boss' machine, not my development machine. I believe the error is generated from a call to an Excel object, but I can't tell...
0
by: Yelena Varshal via AccessMonster.com | last post by:
Hello We have a shortcut for our MS ACCESS application that uses a /Runtime switch because we may have some users that use Runtime. The application worked fine in Access 2000 and was tested with...
7
by: Norman Diamond | last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet Framework 2. Options are set in the setup project properties, so if these two dependencies are not already installed then...
3
by: Jim Armstrong | last post by:
Hello all - This is driving me crazy. I have a table called tblClients - very simple, has the following fields: taxID (PK) ClientName SalesName The main form of my application allows a...
1
by: BL3WC | last post by:
Hi, I'd created a MDE under Access 2003. It is now under testing stage. Some of the users will use Access 2003 runtime and some will use Access 2007 runtime to run this MDE. I installed the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.