473,422 Members | 2,008 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,422 software developers and data experts.

How to track down 3075 error "Unknown"

MLH
Is it a common occurrence for A97 VBA to 'RACE' on past
a debug.print statement?

I have been trying to debug a problem (which turned out to
be an attempt to assign Null to a Date Type variable) and had
several debug.print statements...

10 Good code...
20 Debug.Print "tblBlahBlah", MyVar
30 Good code...
40 Debug.Print "tblBlahBlah", MyVar
50 Good code...
60 Debug.Print "tblBlahBlah", MyVar
70 Good code...
80 Debug.Print "tblBlahBlah", MyVar
90 Bad code...

The above illustrates the situation. I have the erroneous line of code
in Line #90. About 1/3 of the time, lines 20/40/60/80 result in some-
thing really showing up in the immediate window by the time the bad
code in Line #90 is trapped and the error msg displayed - and about
2/3 of the time it does not. It seems as if there's a RACE between VBA
running successive lines and the debug.print statement actually
writing to the immediate window.

time
Nov 27 '05 #1
25 2580
You can change this setting by going to:
Tools -> Options -> International -> General Alignment -> Racist

Nov 27 '05 #2
MLH <CR**@NorthState.net> wrote:
: I have been trying to debug a problem (which turned out to
: be an attempt to assign Null to a Date Type variable) and had
: several debug.print statements...

: 10 Good code...
: 20 Debug.Print "tblBlahBlah", MyVar
: 30 Good code...
: 40 Debug.Print "tblBlahBlah", MyVar
: 50 Good code...
: 60 Debug.Print "tblBlahBlah", MyVar
: 70 Good code...
: 80 Debug.Print "tblBlahBlah", MyVar
: 90 Bad code...

: The above illustrates the situation. I have the erroneous line of code
: in Line #90. About 1/3 of the time, lines 20/40/60/80 result in some-
: thing really showing up in the immediate window by the time the bad
: code in Line #90 is trapped and the error msg displayed - and about
: 2/3 of the time it does not. It seems as if there's a RACE between VBA
: running successive lines and the debug.print statement actually
: writing to the immediate window.

What happen if you single step the code in that region?
I like seeing my debug prints show up one by one.
: time
Nov 27 '05 #3
MLH
very helpful
Nov 28 '05 #4
MLH
I don't know. I got tired of screwing with it. The age-old fallback
for me has always been MsgBox. I give up the ability to select &
copy the output, but it never fails to show up.

What happen if you single step the code in that region?
I like seeing my debug prints show up one by one.
: time


Nov 28 '05 #5
MLH wrote:
The above illustrates the situation. I have the erroneous line of code
in Line #90.


Just set a breakpoint at line 10 and step through it. To set a break
point, put your cursor on the line and Menu Debug->Toggle Breakpoint or
press F9 or simply click in the grey vertical bar on the line where you
want the code to stop. When you run your code, the code will suspend
itself at the breakpoint. You can then press F8 to advance one line at
a time. Holding your mouse over variables while the code is in suspense
will give you what the variable currently is and/or, in the immediate
window (ctrl-G) you can type a question mark and a variable from the
procedure to get the value:

?intMyInteger
1244

OR, possibly even better, you can view the locals window (View->Locals
Window) which will list all objects associated with the procedure.

Armed with the above, and stepping through your code (F8) you will find
what your issue is with the bad code.

Now, answer me a question! 8) How are you numbering code lines? Or do
you just do that when you copy code to a usenet post to help you
identify lines when you're discussing code? TIA.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 28 '05 #6
I'm glad you found it so.
I try to apply the
quid pro quo
concept when answering questions.

Nov 28 '05 #7
On Sun, 27 Nov 2005 09:41:43 -0500, MLH <CR**@NorthState.net> wrote:

It does NOT work like that.
VBA, and all other languages I know of, execute code in one procedure
("stack frame") sequentially, NOT in some multi-threaded way.
In your example, a Debug.Print line would execute BEFORE the next line
executes. Just think about the consequences if that were not the case.
x=4
x=5
Msgbox x 'Crap shoot if this displays 4 or 5.

-Tom.

Is it a common occurrence for A97 VBA to 'RACE' on past
a debug.print statement?

I have been trying to debug a problem (which turned out to
be an attempt to assign Null to a Date Type variable) and had
several debug.print statements...

10 Good code...
20 Debug.Print "tblBlahBlah", MyVar
30 Good code...
40 Debug.Print "tblBlahBlah", MyVar
50 Good code...
60 Debug.Print "tblBlahBlah", MyVar
70 Good code...
80 Debug.Print "tblBlahBlah", MyVar
90 Bad code...

The above illustrates the situation. I have the erroneous line of code
in Line #90. About 1/3 of the time, lines 20/40/60/80 result in some-
thing really showing up in the immediate window by the time the bad
code in Line #90 is trapped and the error msg displayed - and about
2/3 of the time it does not. It seems as if there's a RACE between VBA
running successive lines and the debug.print statement actually
writing to the immediate window.

time


Nov 28 '05 #8
MLH
Thx, Tom.

I'm glad to hear that. How does DoEvents come into play with that?
10 Time = "21:14:05"
20 Debug.Print Time
Based on your comment, I shouldn't worry about sticking a DoEvents
stmt between lines 10 and 20. That's a relief. I'm never really sure
of where I need to stick a DoEvents or not. Of course, it was designed
for some use.

It does NOT work like that.
VBA, and all other languages I know of, execute code in one procedure
("stack frame") sequentially, NOT in some multi-threaded way.
In your example, a Debug.Print line would execute BEFORE the next line
executes. Just think about the consequences if that were not the case.
x=4
x=5
Msgbox x 'Crap shoot if this displays 4 or 5.

-Tom.

Is it a common occurrence for A97 VBA to 'RACE' on past
a debug.print statement?

I have been trying to debug a problem (which turned out to
be an attempt to assign Null to a Date Type variable) and had
several debug.print statements...

10 Good code...
20 Debug.Print "tblBlahBlah", MyVar
30 Good code...
40 Debug.Print "tblBlahBlah", MyVar
50 Good code...
60 Debug.Print "tblBlahBlah", MyVar
70 Good code...
80 Debug.Print "tblBlahBlah", MyVar
90 Bad code...

The above illustrates the situation. I have the erroneous line of code
in Line #90. About 1/3 of the time, lines 20/40/60/80 result in some-
thing really showing up in the immediate window by the time the bad
code in Line #90 is trapped and the error msg displayed - and about
2/3 of the time it does not. It seems as if there's a RACE between VBA
running successive lines and the debug.print statement actually
writing to the immediate window.

time


Nov 28 '05 #9
MLH
How does one, then, know if you're lying?
Perhaps you could insert a brief comment
at the end of your post indicating whether
its a lie or not. Better still, you could ignore
the post. I'll leave it up to your good judgment.
Nov 28 '05 #10
On Mon, 28 Nov 2005 01:05:14 -0500, MLH <CR**@NorthState.net> wrote:

DoEvents makes code re-entrant:
private sub Button0_Click()
for i=1 to 100000
DoSomeThing
DoEvents
next
end sub

This would allow you to click the button multiple times, and multiple
stack frames will run the loop.
Still, this is far from unpredictable, and far from running things out
of order. Rather it is perfectly logical execution, and each
instruction occurs sequentially as it should.

-Tom.
Thx, Tom.

I'm glad to hear that. How does DoEvents come into play with that?
10 Time = "21:14:05"
20 Debug.Print Time
Based on your comment, I shouldn't worry about sticking a DoEvents
stmt between lines 10 and 20. That's a relief. I'm never really sure
of where I need to stick a DoEvents or not. Of course, it was designed
for some use.

It does NOT work like that.
VBA, and all other languages I know of, execute code in one procedure
("stack frame") sequentially, NOT in some multi-threaded way.
In your example, a Debug.Print line would execute BEFORE the next line
executes. Just think about the consequences if that were not the case.
x=4
x=5
Msgbox x 'Crap shoot if this displays 4 or 5.

-Tom.

Is it a common occurrence for A97 VBA to 'RACE' on past
a debug.print statement?

I have been trying to debug a problem (which turned out to
be an attempt to assign Null to a Date Type variable) and had
several debug.print statements...

10 Good code...
20 Debug.Print "tblBlahBlah", MyVar
30 Good code...
40 Debug.Print "tblBlahBlah", MyVar
50 Good code...
60 Debug.Print "tblBlahBlah", MyVar
70 Good code...
80 Debug.Print "tblBlahBlah", MyVar
90 Bad code...

The above illustrates the situation. I have the erroneous line of code
in Line #90. About 1/3 of the time, lines 20/40/60/80 result in some-
thing really showing up in the immediate window by the time the bad
code in Line #90 is trapped and the error msg displayed - and about
2/3 of the time it does not. It seems as if there's a RACE between VBA
running successive lines and the debug.print statement actually
writing to the immediate window.

time


Nov 28 '05 #11

MLH wrote:
I don't know. I got tired of screwing with it. The age-old fallback
for me has always been MsgBox. I give up the ability to select &
copy the output, but it never fails to show up.


One can copy the text output of a MsgBox with <Ctrl><C> while the
MsgBox is displayed.
One can copy the graphic output with <Alt><PrtScr>.

To tell if I am lying, try what I have suggested.

Nov 28 '05 #12
MLH
All I can say is good luck to anyone who believes CTRL-C will
copy the contents of a MsgBox to the clipboard. Shift-PrtScr has
always worked for me. I wouldn't know anything about ALT-PrtScr,
I have never used it.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx

MLH wrote:
I don't know. I got tired of screwing with it. The age-old fallback
for me has always been MsgBox. I give up the ability to select &
copy the output, but it never fails to show up.


One can copy the text output of a MsgBox with <Ctrl><C> while the
MsgBox is displayed.
One can copy the graphic output with <Alt><PrtScr>.

To tell if I am lying, try what I have suggested.


Nov 28 '05 #13
MLH
Thx, Tom.
xxxxxxxxxxxxxxxxxxxxxxxx

DoEvents makes code re-entrant:
private sub Button0_Click()
for i=1 to 100000
DoSomeThing
DoEvents
next
end sub

This would allow you to click the button multiple times, and multiple
stack frames will run the loop.
Still, this is far from unpredictable, and far from running things out
of order. Rather it is perfectly logical execution, and each
instruction occurs sequentially as it should.

-Tom.
Thx, Tom.

I'm glad to hear that. How does DoEvents come into play with that?
10 Time = "21:14:05"
20 Debug.Print Time
Based on your comment, I shouldn't worry about sticking a DoEvents
stmt between lines 10 and 20. That's a relief. I'm never really sure
of where I need to stick a DoEvents or not. Of course, it was designed
for some use.

It does NOT work like that.
VBA, and all other languages I know of, execute code in one procedure
("stack frame") sequentially, NOT in some multi-threaded way.
In your example, a Debug.Print line would execute BEFORE the next line
executes. Just think about the consequences if that were not the case.
x=4
x=5
Msgbox x 'Crap shoot if this displays 4 or 5.

-Tom.
Is it a common occurrence for A97 VBA to 'RACE' on past
a debug.print statement?

I have been trying to debug a problem (which turned out to
be an attempt to assign Null to a Date Type variable) and had
several debug.print statements...

10 Good code...
20 Debug.Print "tblBlahBlah", MyVar
30 Good code...
40 Debug.Print "tblBlahBlah", MyVar
50 Good code...
60 Debug.Print "tblBlahBlah", MyVar
70 Good code...
80 Debug.Print "tblBlahBlah", MyVar
90 Bad code...

The above illustrates the situation. I have the erroneous line of code
in Line #90. About 1/3 of the time, lines 20/40/60/80 result in some-
thing really showing up in the immediate window by the time the bad
code in Line #90 is trapped and the error msg displayed - and about
2/3 of the time it does not. It seems as if there's a RACE between VBA
running successive lines and the debug.print statement actually
writing to the immediate window.

time


Nov 28 '05 #14
MLH wrote:
All I can say is good luck to anyone who believes CTRL-C will
copy the contents of a MsgBox to the clipboard.


You're wishing good luck to everyone? How kind of you!

Nov 28 '05 #15
MLH wrote:
All I can say is good luck to anyone who believes CTRL-C will
copy the contents of a MsgBox to the clipboard.


I tried this - it works nicely in A2003, but does not work in my
installation of A97, which is of concern to you. Still thanks to Lyle
for a useful hint I hadn't encountered before.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 28 '05 #16
Tim Marshall <TI****@PurplePandaChasers.Moertherium> wrote in
news:dm**********@coranto.ucs.mun.ca:
MLH wrote:
All I can say is good luck to anyone who believes CTRL-C will
copy the contents of a MsgBox to the clipboard.


I tried this - it works nicely in A2003, but does not work in my
installation of A97, which is of concern to you. Still thanks to
Lyle for a useful hint I hadn't encountered before.


But you could use Terry Kreft's clipboard API functions to copy the
message to the clipboard before the MsgBox loads, and then you'd
have the same data as you'd get in later versions of Access:

http://www.mvps.org/access/api/api0049.htm

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 28 '05 #17
MLH <CR**@NorthState.net> wrote in
news:c9********************************@4ax.com:
All I can say is good luck to anyone who believes CTRL-C will
copy the contents of a MsgBox to the clipboard. Shift-PrtScr has
always worked for me. I wouldn't know anything about ALT-PrtScr,
I have never used it.


Lyle very often neglects to consider that others aren't using the
latest version of Access.

He is correct that in later versions of Access, Ctrl-C works.

He just doesn't pay close enough attention to know that you're
working in A97.

As I said in another post, you could replicate this functionality by
copying the message text to the clipboard before the call to the
MsgBox function using Terry Kreft's clipboard API code:

http://www.mvps.org/access/api/api0049.htm

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 28 '05 #18
Is it the Windows version or the Office Version?
If your Ac2003 and your AC97 are on the same machine then we can
conclude it's the Office version?

Nov 29 '05 #19
Sky
"Lyle Fairfield" <ly***********@aim.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Is it the Windows version or the Office Version?


In Access 2000,

Ctrl-C works to copy this:
MsgBox "Hello"

Ctrl-C fails to copy this:
Eval("MsgBox(""Hello With Eval"")")

The latter can be used to permit bold face with the "@" symbol, just
like
Access 97.

- Steve

Nov 29 '05 #20
David W. Fenton wrote:
But you could use Terry Kreft's clipboard API functions to copy the
message to the clipboard before the MsgBox loads, and then you'd
have the same data as you'd get in later versions of Access:

http://www.mvps.org/access/api/api0049.htm


True. I use Terry's clipboard APIs a lot in my apps. Still, I think it
far easier for MLH to just do the very basics I suggested in a post he
probably hasn't seen, a suggestion similar to Thelma Lubkin's. Perhaps
I've yelled at him too many times, myself. Though, maybe if we all did
it instead of being so touchy-feely-let's-not-hurt-his-feelings he might
learn some goddamn thing and RTFM first instead of constant posting over
stuff that one should be able to find in the great A97 help file. Mind
you, this particular thread is probably a legitimate question for a
newbie...
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 29 '05 #21
Lyle Fairfield wrote:
Is it the Windows version or the Office Version?
If your Ac2003 and your AC97 are on the same machine then we can
conclude it's the Office version?


Both from the respective Office Pro packages. What's the Windows
version? Is that just Access by itself? Is there a distinction btween
the two?

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 29 '05 #22
Access like almost every application does nothing itself; it calls OS
functions; they do the work. It's conceivable (at least to me) that the
difference noted in <Ctrl><C> and MsgBox could be due to the Windows
version (say Windows 98 as opposed to Windows XP) and not the Office
version.

Nov 29 '05 #23
Sorry Lyle it's not.

Windows Server 2003
Office 2003 - msgbox - Ctrl-C you can paste the text into notepad
Office 97 - msgbox - Ctrl-C you can't paste the text into notepad

--
Terry Kreft

"Lyle Fairfield" <ly***********@aim.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Access like almost every application does nothing itself; it calls OS
functions; they do the work. It's conceivable (at least to me) that the
difference noted in <Ctrl><C> and MsgBox could be due to the Windows
version (say Windows 98 as opposed to Windows XP) and not the Office
version.

Nov 29 '05 #24
Lyle Fairfield wrote:
Access like almost every application does nothing itself; it calls OS
functions; they do the work. It's conceivable (at least to me) that the
difference noted in <Ctrl><C> and MsgBox could be due to the Windows
version (say Windows 98 as opposed to Windows XP) and not the Office
version.


As Sky correctly pointed out, using Eval(Msgbox) you can't use Ctrl+C
and supports A97's @ formatting, I've not got A97 to test but from that
I would deduce that it's down to the Access version if not both.
Nov 30 '05 #25
MLH
It does sound pretty cool.
xxxxxxxxxxxxxxxxxxxxxxxxxxx

On Mon, 28 Nov 2005 11:47:39 -0330, Tim Marshall
<TI****@PurplePandaChasers.Moertherium> wrote:
MLH wrote:
All I can say is good luck to anyone who believes CTRL-C will
copy the contents of a MsgBox to the clipboard.


I tried this - it works nicely in A2003, but does not work in my
installation of A97, which is of concern to you. Still thanks to Lyle
for a useful hint I hadn't encountered before.


Nov 30 '05 #26

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

Similar topics

3
by: Marcus | last post by:
I'm running into a situation that has me adding a value of "Unknown" to a reference table. I am being pulled between two trains of thought, and was curious to get other's input on in. I give an...
0
by: Mike Leahy | last post by:
Okay.I'm following the documentation that came with the PostgreSQL source code (located in /usr/doc/postgresql-7.3.4-2/html/arrays.hmtl in my cygwin root). I created have a table with a varchar...
0
by: wilsonchan1000 | last post by:
There is a note regarding this error in UDB. I eventually found a solution and want to share with all or you. Problem occur with connect to db2 server: SQLCODE : -332 SQL0332N There is no...
2
by: John Baker | last post by:
Hi: I have two systems, one a W98 and the other XP Home. I have Access 2000 installed on both, and have run into a difference in the way the two behave. I have a table on which I wish to reset...
0
by: David P. Donahue | last post by:
I'm using C# to create an ASP .NET website backed by a MySQL database. One of the things I do often on the site is populate a DataList by binding it to a DataSet pulled from the database. However,...
3
by: Ed L. | last post by:
On 7.4.6, is there any problem with defining one column of a view to be a string literal? For example ... $ psql -c "create view fooview as select 'bar' as footype" WARNING: column "footype"...
0
by: multisync | last post by:
I'm getting the following error: Unknown error (0x80005000) It gives this error on the line "results = searcher.FindAll()" -----code------ Dim rootentry As New...
9
by: Klaus Johannes Rusch | last post by:
IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example document.write(typeof window.missingproperty); Has "unknown" been defined...
0
by: Peter Nofelt | last post by:
Hi all, ISSUE: ==================== In SQL 2005 (sp2) I get the following error when preforming a bulk insert with an associated xml format file: "Could not bulk insert. Unknown version of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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...
0
Oralloy
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,...
0
jinu1996
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...
0
tracyyun
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.