CurrentUser()返回null [英] CurrentUser() returns null

查看:105
本文介绍了CurrentUser()返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


当从表单事件处理程序调用时,CurrentUser()返回null,

至少来自Form_Open()!


但是,它在其他形式下工作正常!


使用Application.CurrentUser似乎工作,但我宁愿得到

CurrentUser()工作,因为有很多电话。


感谢您的阅读,


Mourad

解决方案

(重新发布,因为我的原始回复没有出现)


"的Mourad"在留言中写道

news:92 ********************************** @ i20g2000 prf.googlegroups.com ...


大家好,


当从表单事件调用时,CurrentUser()返回null处理程序,至少来自Form_Open()



但是,它在其他形式下工作正常!


使用Application.CurrentUser似乎工作,但我宁愿得到

CurrentUser()工作,因为有太多的调用。



我的猜测是你有一个名为CurrentUser的东西在范围内

,当你从这个表格中调用它时公开赛。你有控制,

字段,还是名为CurrentUser的变量?


-

Dirk Goldgar,MS Access MVP
www.datagnostics.com


(请回复新闻组)


谢谢Dirk,


Nop! $ =
调试器甚至没有进入CurrentUser()函数!


它仍然返回null !!


谢谢,

Mourad


" Mourad" ; < mo ************ @ gmail.comwrote in message

news:a3 ****************** **************** @ a18g2000 pra.googlegroups.com ...


谢谢Dirk,


Nop!代码中的任何地方都没有用户定义的CurrentUser()。


调试器甚至不会进入CurrentUser()函数!



如果是CurrentUser你所指的功能是内置功能,我不希望调试器进入它。


如果单击Debug - >在VB编辑器中编译,是否发现任何编译错误?

它以其他形式工作但不是以特定形式工作的事实

强烈建议那个特定形式的东西是问题所在。如果您创建一个新数据库,将该表单和任何必要的支持表,查询和模块导入其中,是否需要调用

CurrentUser在表单上工作数据库?


如果没有,如果你想给我发一个(压缩)的数据库副本看看

at,你可以发送给通过删除NO SPAM获得的地址和

" .invalid"来自此消息的回复地址。


-

Dirk Goldgar,MS Access MVP
www.datagnostics.com


(请回复新闻组)


Hi All,

CurrentUser() returns null when called from a form event handler, at
least from Form_Open()!

However, it works fine in other forms!

Use Application.CurrentUser seem to work, but I''d rather get
CurrentUser() to work, since there are so many calls to it.

Thanks for reading,

Mourad

解决方案

(re-posting, as my original reply hasn''t appeared)

"Mourad" wrote in message
news:92**********************************@i20g2000 prf.googlegroups.com...

Hi All,

CurrentUser() returns null when called from a form event handler, at
least from Form_Open()!

However, it works fine in other forms!

Use Application.CurrentUser seem to work, but I''d rather get
CurrentUser() to work, since there are so many calls to it.


My guess is that you have something else named CurrentUser that is in scope
at the time you call it from this form''s Open event. Do you have a control,
field, or variable named CurrentUser?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


Thanks Dirk,

Nop! There is no user defined CurrentUser() anywhere in the code.

The debugger even does not step into CurrentUser() function!

It still returns null!!

Thanks,

Mourad


"Mourad" <mo************@gmail.comwrote in message
news:a3**********************************@a18g2000 pra.googlegroups.com...

Thanks Dirk,

Nop! There is no user defined CurrentUser() anywhere in the code.

The debugger even does not step into CurrentUser() function!


If the "CurrentUser" function you are referring to is the built-in one, I
wouldn''t expect the debugger to step into it.

If you click Debug ->Compile in the VB editor, are any compile errors found?

The fact that it works in other forms but not in one particular form
strongly suggests that there''s something about that particular form that is
the problem. If you create a new database, import that form and any
necessary supporting tables, queries, and modules into it, does the call to
CurrentUser work on the form in that database?

If not, and if you want to send me a (zipped) copy of that database to look
at, you can send it to the address you get by removing "NO SPAM" and
".invalid" from the reply address of this message.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


这篇关于CurrentUser()返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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