过时的帮助(专长。访问'97和VB4) [英] Outdated help (feat. Access '97 and VB4)

查看:44
本文介绍了过时的帮助(专长。访问'97和VB4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在使用一个简单的Access''97 + VB4应用程序,我遇到了一个可怕的问题:我从未修改过的东西给了我一个完全

不需要的无效使用null错误。

它发生在一个Text.LostFocus事件中,这个块:


请不要TB6.EOF

如果年份(TB6(0))= Val(Trim(Text1.Text))然后

!!!!!!!!!!!!!这里!!!!!!!!!

...

bla bla bla

...

结束如果


TB6是一张桌子。将Text1中的文本与TB6中第一列中的文本进行比较

。检查数据库本身,我有2002年,2002年,2003年,2005年的
条目......直到今天早上所有的一切

工作得非常好。现在,它只适用于2005年,而其他值是

被认为是null并且错误很少。

有什么想法吗?我真的不知道该怎么办。

谢谢!

ZDS

Hello,
I''m working at a simple Access ''97 + VB4 application, and I ran into a
terrible problem: something I never modified now gives me a totally
unwanted "Invalid use of null" error.
It happens in a Text.LostFocus event, this block:

Do While Not TB6.EOF
If Year(TB6(0)) = Val(Trim(Text1.Text)) Then
!!!!!!!!!!!!!Here!!!!!!!!!
...
bla bla bla
...
End If

Where TB6 is a table. The text in Text1 is compared to the Year taken
out of the first colum in TB6. Checking the database itself, I have
entries for 2002, 2002, 2003, 2005... and up to this morning everything
worked so good. Now, it only works ok for 2005, while other values are
considered to be null and error creeps in.
Any idea? I really don''t know what to do.
Thanks!
ZDS

推荐答案

如果Text1.Text为NULL,那你怎么修剪它?


试试这个...


Val(修剪(Text1.Text&""))


这将强制NULL为空字符串,可以修剪。


-


Danny J. Lesandrini
dl ** *******@hotmail.com
http:// amazecreations .com / datafast

" ZillionDollarSadist" < CA ******* @ gmail.com>写道...
If Text1.Text is NULL, then how can you trim it?

Try this ...

Val(Trim(Text1.Text & ""))

This will force the NULL to an empty string, which can be trimmed.

--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast
"ZillionDollarSadist" <ca*******@gmail.com> wrote ...
您好,我正在使用一个简单的Access''97 + VB4应用程序,我遇到了一个可怕的问题:我从未修改过的东西现在给了我一个完全不需要的无效使用null错误。
它发生在Text.LostFocus事件中,这个块:

不要TB6.EOF
如果年(TB6(0))= Val(修剪(Text1) .Text))然后
!!!!!!!!!!!!!这里!!!!!!!!!
...
bla bla bla
......
结束如果

TB6是一张桌子。将Text1中的文本与TB6中第一列中的文本进行比较。检查数据库本身,我有2002年,2002年,2003年,2005年的条目......直到今天早上,一切都很好。现在,它只适用于2005年,而其他值被认为是空的并且错误很少。
任何想法?我真的不知道该怎么做。
谢谢!
ZDS
Hello,
I''m working at a simple Access ''97 + VB4 application, and I ran into a
terrible problem: something I never modified now gives me a totally
unwanted "Invalid use of null" error.
It happens in a Text.LostFocus event, this block:

Do While Not TB6.EOF
If Year(TB6(0)) = Val(Trim(Text1.Text)) Then
!!!!!!!!!!!!!Here!!!!!!!!!
...
bla bla bla
...
End If

Where TB6 is a table. The text in Text1 is compared to the Year taken
out of the first colum in TB6. Checking the database itself, I have
entries for 2002, 2002, 2003, 2005... and up to this morning everything
worked so good. Now, it only works ok for 2005, while other values are
considered to be null and error creeps in.
Any idea? I really don''t know what to do.
Thanks!
ZDS



嗯,我想我没有足够解释自己。 Text1.Text绝不是空的b $ b。但是年份(TB6(0))是,并且它不应该 - 它的值取自

一个Access表,其中第0列中有一个日期。事实是,第0列

永远不会是空的。它有很多2001,2002,2003的条目和2005年的一些

。只有后者,现在,被认为不是空的。

完全荒谬,因为一些几小时前一切都运转正常,我没有&b $ b更改任何与此相关的内容..

ZDS

Mmmh, I think I didn''t explain myself enough. Text1.Text is never
empty. But Year(TB6(0)) is, and it shouldn''t - its value is taken from
an Access table where there''s a date in column 0. The fact is, column 0
is never empty. It has lots of entries for 2001, 2002, 2003 and some
for 2005. And only the latter ones, NOW, are considered not null.
Totally absurd since a few hours ago it all worked ok and I didn''t
change anything related to this..
ZDS


是的,我想我完全忽略了这一部分,因为它对我来说没有任何意义。那个语法引用了什么?数组?


年份(TB6(0))


那么,TB6()和数组是否需要元素零?它是变种

数组吗?如果是这样,则TB6(0)为NULL,你必须处理它。


年(Nz(TB6(0),0))

- -


Danny J. Lesandrini
dl ***** ****@hotmail.com
http://amazecreations.com/ datafast

" ZillionDollarSadist" < CA ******* @ gmail.com>写了...
Yeah, I guess I completely ignored that part, since it didn''t make the
least bit of sense to me. What does that syntax reference? An array?

Year(TB6(0))

So, is TB6() and array and you want element zero? Is it a variant
array? If so, then TB6(0) is NULL and you have to handle that.

Year(Nz(TB6(0),0))
--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast
"ZillionDollarSadist" <ca*******@gmail.com> wrote ...
嗯,我想我没有解释自己。 Text1.Text永远不会是空的。但是年份(TB6(0))是,并且它不应该 - 它的值取自
一个Access表,其中第0列中有一个日期。事实是,第0列
是从来没有空它有2001,2002,2003和2005年的一些条目。现在只有后者,现在被认为不是空的。
几个小时前完全荒谬它们都运行正常我并没有改变与此相关的任何内容..
ZDS
Mmmh, I think I didn''t explain myself enough. Text1.Text is never
empty. But Year(TB6(0)) is, and it shouldn''t - its value is taken from
an Access table where there''s a date in column 0. The fact is, column 0
is never empty. It has lots of entries for 2001, 2002, 2003 and some
for 2005. And only the latter ones, NOW, are considered not null.
Totally absurd since a few hours ago it all worked ok and I didn''t
change anything related to this..
ZDS



这篇关于过时的帮助(专长。访问'97和VB4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆