错误3220 - 表级别验证表达式中的表达式中无法使用函数 [英] Error 3220 - Function Is Not Available In Expression In Table Level Validation Expression

查看:73
本文介绍了错误3220 - 表级别验证表达式中的表达式中无法使用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个非常奇怪的问题,欢迎任何帮助。


我在Access 2002中开发了一个应用程序。该应用程序在

开发机器上运行完美。我使用Microsoft XP Developer Packaging Wizard(Service Pack 1)打包了应用程序

。该应用程序的第一个

3版本在

网站上完美运行。


周五该应用程序的第4个版本发布了给客户。该应用程序完全打开了

,但在我的登录表单上单击确定

我收到错误:3220 - 该功能在表达式中不可用

表级验证表达式。


我把2个主文件作为一个包含应用程序的mde文件和一个mdb

文件,其中包含链接到

mde文件来自安装光盘上的支持目录并将它们复制到一台装有Office XP Professional

的机器上(我可以不模拟用于开发的盒子上的错误)。我发现当我进入一张桌子时,当我手动输入一个记录时,我得到了相同的错误,这个奇怪的部分既不是

表格和填充表格的代码

自应用程序的第一个版本发生了变化(实际上它是我用于

表和模块的代码,我用于许多其他的

应用程序)。


表格布局如下:


Key AutoNumber主键

用户名文字(15)强制

无默认值

SecurityLevel长整数强制

默认值0

DBChanged文字(20)强制性

无默认值

RecordChanged文字(100)强制性

无默认值

DBAction文本(100)强制性

无默认值

DateChanged日期/时间强制性

默认值日期()

TimeChanged日期/时间强制

默认值时间()

TillNo整数

默认值0

用于填充表格的代码如下:


Sub logchg(tbl As String,rec As Variant,action As String)

Dim srec As String

Dim logrs As Recordset


srec = CStr(rec)


设置logrs = db.OpenRecordset(" tblLog")

logrs.AddNew

logrs![UserName] = modGlobals.user

logrs![SecurityLevel] = modGlobals.SecurityLevel

logrs![DbChanged] = tbl

logrs![RecordChanged] = srec

logrs![DBAction] = action

logrs![TillNo] = modGlobals.TillNo

logrs.Update

logrs.C丢失

结束子


导致错误的电话是:


调用modSecurity.logchg(" N / A,N / A,登录)


任何人都可以解释我收到错误的原因吗?


TIA

Steve

Hi

I have a really weird problem and any assistance would be welcome.

I have developed an app in Access 2002. The app runs perfectly on the
development machine. I have packaged the app
using the Microsoft XP Developer Packaging Wizard (Service Pack 1). The 1st
3 releases of the app ran perfectly on
site.

On Friday the 4th release of the app went out to a customer. The app opened
perfectly but on clicking OK on my login form
I get the error : 3220 - The functiom is not available in expression in
table level validation expression.

I took the 2 main files one mde file containing the application and an mdb
file containing the data which is linked into the
mde file from the support directory on the installation CD and copied them
to a machine which has Office XP Professional
loaded (as I can not simulate the error on the box used for development). I
found that when I went into a table that when
manually entering a record I got the same error, the weird part is neither
the table nor the code populating the table
has changed since the 1st release of the app (In fact it is code I use for a
table and module that I use in many other
applications).

The table layout is as follows :

Key AutoNumber Primary Key
UserName Text(15) Mandatory
No Default Value
SecurityLevel Long Integer Mandatory
Default Value 0
DBChanged Text(20) Mandatory
No Default Value
RecordChanged Text(100) Mandatory
No Default Value
DBAction Text(100) Mandatory
No Default Value
DateChanged Date/Time Mandatory
Default Value Date()
TimeChanged Date/Time Mandatory
Default Value Time()
TillNo Integer
Default Value 0
The code used to populate the table is as follows :

Sub logchg(tbl As String, rec As Variant, action As String)
Dim srec As String
Dim logrs As Recordset

srec = CStr(rec)

Set logrs = db.OpenRecordset("tblLog")
logrs.AddNew
logrs![UserName] = modGlobals.user
logrs![SecurityLevel] = modGlobals.SecurityLevel
logrs![DbChanged] = tbl
logrs![RecordChanged] = srec
logrs![DBAction] = action
logrs![TillNo] = modGlobals.TillNo
logrs.Update
logrs.Close
End Sub

The call that causes the error is :

Call modSecurity.logchg("N/A", "N/A", "LOGON")

Can anyone explain why I get the error ?

TIA
Steve

推荐答案

Steve写道:
Steve wrote:

我有一个非常奇怪的问题,欢迎任何帮助。

我在Access 2002中开发了一个应用程序。该应用程序在
开发机器上运行完美。我使用Microsoft XP Developer Packaging Wizard(Service Pack 1)打包了应用程序。该应用程序的第一个版本在
网站上完美运行。

周五,该应用程序的第4个版本发布给了客户。该应用程序完全打开
但在我的登录表单上单击确定
我收到错误:3220 - 表级别验证表达式中的表达式中没有该功能。
文件,其中包含从安装光盘上的support目录链接到
mde文件的数据并复制它们。 >加载了Office XP Professional的机器(因为我无法模拟用于开发的盒子上的错误)。我发现当我进入一张桌子时,当手动输入一条记录时,我得到了同样的错误,奇怪的部分既不是表格,也不是填写表格的代码
自应用程序的第一个版本发布以来已经发生了变化(实际上它是我用于许多其他
应用程序的表格和模块的代码)。

表格布局如下:

键自动编号主键
用户名文字(15)必填
无默认值
SecurityLevel Long Integer强制
默认值0
DBChanged文本(20)必填
无默认值
RecordChanged文本(100)必填
无默认值
DBAction文本(100)必填
无默认值
DateChanged日期/时间必备
默认值日期()
TimeChanged日期/时间必备
默认值时间()
TillNo整数
默认值0

用于填充表的代码如下:

Sub logchg(tbl As String,rec As Variant,action as String)
Dim srec As String
Dim logrs As Recordset

srec = CStr(rec)

设置logrs = db.OpenRecordset(" tblLog")
logrs.AddNew
logrs![UserName] = modGlobals.user
logrs![SecurityLevel] = modGlobals.SecurityLevel
logrs![DbChanged] = tbl
logrs![RecordChanged] = srec
logrs![DBAction] = action
logrs![TillNo] = modGlobals.TillNo
logrs.Update
logrs.Close
End Sub

导致错误的电话是:

调用modSecurity.logchg(N / A,N / A,LOGON)

任何人都可以解释为什么我g等错误?

TIA
Steve
Hi

I have a really weird problem and any assistance would be welcome.

I have developed an app in Access 2002. The app runs perfectly on the
development machine. I have packaged the app
using the Microsoft XP Developer Packaging Wizard (Service Pack 1). The 1st
3 releases of the app ran perfectly on
site.

On Friday the 4th release of the app went out to a customer. The app opened
perfectly but on clicking OK on my login form
I get the error : 3220 - The functiom is not available in expression in
table level validation expression.

I took the 2 main files one mde file containing the application and an mdb
file containing the data which is linked into the
mde file from the support directory on the installation CD and copied them
to a machine which has Office XP Professional
loaded (as I can not simulate the error on the box used for development). I
found that when I went into a table that when
manually entering a record I got the same error, the weird part is neither
the table nor the code populating the table
has changed since the 1st release of the app (In fact it is code I use for a
table and module that I use in many other
applications).

The table layout is as follows :

Key AutoNumber Primary Key
UserName Text(15) Mandatory
No Default Value
SecurityLevel Long Integer Mandatory
Default Value 0
DBChanged Text(20) Mandatory
No Default Value
RecordChanged Text(100) Mandatory
No Default Value
DBAction Text(100) Mandatory
No Default Value
DateChanged Date/Time Mandatory
Default Value Date()
TimeChanged Date/Time Mandatory
Default Value Time()
TillNo Integer
Default Value 0
The code used to populate the table is as follows :

Sub logchg(tbl As String, rec As Variant, action As String)
Dim srec As String
Dim logrs As Recordset

srec = CStr(rec)

Set logrs = db.OpenRecordset("tblLog")
logrs.AddNew
logrs![UserName] = modGlobals.user
logrs![SecurityLevel] = modGlobals.SecurityLevel
logrs![DbChanged] = tbl
logrs![RecordChanged] = srec
logrs![DBAction] = action
logrs![TillNo] = modGlobals.TillNo
logrs.Update
logrs.Close
End Sub

The call that causes the error is :

Call modSecurity.logchg("N/A", "N/A", "LOGON")

Can anyone explain why I get the error ?

TIA
Steve




我有A97,错误3220引用Paradox而2426是函数isn' '*

表达式中可用。你的错误有一个附录

TableLevelValidation到我的2426.


打开你的表tblLog。您正在更新的任何
字段中是否有验证规则?也许制作当前日志表的副本和

然后打开日志文件并删除任何验证规则和文本。


如果那不是'' t帮助,有没有办法验证LogChg中哪一行

爆炸了? IOW,单步执行代码并找到你所在的字段

更新问题的原因。



I have A97, and error 3220 referes to Paradox and 2426 is Function isn''t
available in expressions. Your error has the addendum of
TableLevelValidation to my 2426.

Open up your table tblLog. Do you have a validation rule on any of the
fields you are updating? Maybe make a copy of the current log table and
then open the log file and remove any validation rules and text of so.

If that doesn''t help, is there a way to verify what line in LogChg that
blows up? IOW, step through code and locate which field you are
updating that is the cause of the problem.





沙拉 < oi*@vinegar.com>在消息中写道

新闻:Ds ****************** @ newsread1.news.pas.earth link.net ...

"Salad" <oi*@vinegar.com> wrote in message
news:Ds******************@newsread1.news.pas.earth link.net...
史蒂夫写道:
Steve wrote:


我有一个非常奇怪的问题,欢迎任何帮助。

我在Access 2002中开发了一个应用程序。该应用程序在
开发机器上运行完美。我使用Microsoft XP Developer Packaging Wizard(Service Pack 1)打包了应用程序。应用程序的
前3版本在
网站上完美运行。

周五,应用程序的第4个版本发布给了客户。应用程序
完美打开但在我的登录表单上单击确定
我收到错误:3220 - 表级别验证表达式中的表达式中没有该函数。
mdb文件,其中包含从安装光盘上的支持目录链接到
mde文件的数据,并复制了
他们加载了一台装有Office XP Professional的机器(因为我无法模拟用于
开发的盒子上的错误)。我发现,当我进入一个表格时,当手动输入一个记录时,我得到了同样的错误,奇怪的部分是
,表格和填充表格的代码都没有改变,因为应用程序的第一个版本(实际上它是代码我使用
表示我在许多其他
应用程序中使用的表和模块)。

表格布局如下:

密钥自动编号主键
用户名文本(15)
强制无默认值
SecurityLevel长整数
强制默认值0
DBChanged Text (20)
强制无默认值
RecordChanged文本(100)强制
无默认值
DBAction文本(100)
强制无默认值
DateChanged日期/时间
强制性默认值日期()
TimeChanged日期/时间
强制性默认值时间()
TillNo整数
默认值V alue 0

用于填充表的代码如下:

Sub logchg(tbl As String,rec As Variant,action as String)
Dim srec作为String
Dim logrs作为Recordset

srec = CStr(rec)

设置logrs = db.OpenRecordset(" tblLog")
logrs。 AddNew
logrs![UserName] = modGlobals.user
logrs![SecurityLevel] = modGlobals.SecurityLevel
logrs![DbChanged] = tbl
logrs![RecordChanged] = srec
logrs![DBAction] =动作
logrs![TillNo] = modGlobals.TillNo
logrs.Update
logrs.Close
End Sub
导致错误的调用是:

调用modSecurity.logchg(N / A,N / A,LOGON)

可以有人解释我为什么会收到这个错误吗?

TIA
Steve
Hi

I have a really weird problem and any assistance would be welcome.

I have developed an app in Access 2002. The app runs perfectly on the
development machine. I have packaged the app
using the Microsoft XP Developer Packaging Wizard (Service Pack 1). The 1st 3 releases of the app ran perfectly on
site.

On Friday the 4th release of the app went out to a customer. The app opened perfectly but on clicking OK on my login form
I get the error : 3220 - The functiom is not available in expression in
table level validation expression.

I took the 2 main files one mde file containing the application and an mdb file containing the data which is linked into the
mde file from the support directory on the installation CD and copied them to a machine which has Office XP Professional
loaded (as I can not simulate the error on the box used for development). I found that when I went into a table that when
manually entering a record I got the same error, the weird part is neither the table nor the code populating the table
has changed since the 1st release of the app (In fact it is code I use for a table and module that I use in many other
applications).

The table layout is as follows :

Key AutoNumber Primary Key
UserName Text(15) Mandatory No Default Value
SecurityLevel Long Integer Mandatory Default Value 0
DBChanged Text(20) Mandatory No Default Value
RecordChanged Text(100) Mandatory
No Default Value
DBAction Text(100) Mandatory No Default Value
DateChanged Date/Time Mandatory Default Value Date()
TimeChanged Date/Time Mandatory Default Value Time()
TillNo Integer
Default Value 0
The code used to populate the table is as follows :

Sub logchg(tbl As String, rec As Variant, action As String)
Dim srec As String
Dim logrs As Recordset

srec = CStr(rec)

Set logrs = db.OpenRecordset("tblLog")
logrs.AddNew
logrs![UserName] = modGlobals.user
logrs![SecurityLevel] = modGlobals.SecurityLevel
logrs![DbChanged] = tbl
logrs![RecordChanged] = srec
logrs![DBAction] = action
logrs![TillNo] = modGlobals.TillNo
logrs.Update
logrs.Close
End Sub

The call that causes the error is :

Call modSecurity.logchg("N/A", "N/A", "LOGON")

Can anyone explain why I get the error ?

TIA
Steve



我有A97,错误3220引用Paradox而2426是函数isn' '
表达式可用。你的错误有我的2426的TableLevelValidation的附录。

打开你的表tblLog。您是否对要更新的任何
字段都有验证规则?也许制作当前日志表的副本然后打开日志文件并删除任何验证规则和文本。

如果这没有帮助,有没有办法验证LogChg中哪一行会爆炸? IOW,单步执行代码并找到您正在更新的哪个字段是导致问题的原因。



I have A97, and error 3220 referes to Paradox and 2426 is Function isn''t
available in expressions. Your error has the addendum of
TableLevelValidation to my 2426.

Open up your table tblLog. Do you have a validation rule on any of the
fields you are updating? Maybe make a copy of the current log table and
then open the log file and remove any validation rules and text of so.

If that doesn''t help, is there a way to verify what line in LogChg that
blows up? IOW, step through code and locate which field you are
updating that is the cause of the problem.



感谢您的回复,我没有验证规则设置好了,代码

似乎崩溃了:


logrs.Update


不幸告诉我什么都没有。


史蒂夫


Thanks for the response, I have no validation rule set up, and the code
seems to crash on :

logrs.Update

which unfortunately tells me nothing.

Steve


史蒂夫写道:
Steve wrote:
我有A97,错误3220引用Paradox而2426是函数在表达式中不可用。你的错误有我的2426的TableLevelValidation的附录。

打开你的表tblLog。您是否对要更新的任何
字段都有验证规则?也许制作当前日志表的副本然后打开日志文件并删除任何验证规则和文本。

如果这没有帮助,有没有办法验证LogChg中哪一行会爆炸? IOW,逐步执行代码并找到您正在更新的哪个字段是导致问题的原因。
I have A97, and error 3220 referes to Paradox and 2426 is Function isn''t
available in expressions. Your error has the addendum of
TableLevelValidation to my 2426.

Open up your table tblLog. Do you have a validation rule on any of the
fields you are updating? Maybe make a copy of the current log table and
then open the log file and remove any validation rules and text of so.

If that doesn''t help, is there a way to verify what line in LogChg that
blows up? IOW, step through code and locate which field you are
updating that is the cause of the problem.


感谢您的回复,我没有设置验证规则,代码
logrs.Update

不幸的是什么也没告诉我。

Steve


Thanks for the response, I have no validation rule set up, and the code
seems to crash on :

logrs.Update

which unfortunately tells me nothing.

Steve




好​​的。你知道这条线。它告诉你,有一个价值,它不会像我所知道的那样... ...我会假设您知道如何逐步完成

代码。如果没有,请单击AddNew行左侧的栏,该栏将

点放在栏上并突出显示该行。现在运行该过程。检查

您在记录集中更新的每个项目的值。


另外,复制代码并放入模块。而不是插入程序中的

值,尝试添加有效值。例如:

logrs![UserName] =" Steve"

为所有字段执行此操作。如果你不能用手动插入

添加记录并且该字段的值是正确的,也许你

有一个与某些东西冲突的现有记录。


你什么时候打电话给这个?我有一个主要表单,称为一些函数

和查询使用NZ()和其他类似的东西。一旦表格加载了b $ b,就可以使用我正在使用的功能。但是在加载

表格时,VBA功能不可用。


如果你一直在使用这种方法,我怀疑是这种情况虽然。

检查你的数据。


如果你可以添加一个包含手动数据的记录,当你的数据看起来没问题时

单步执行代码,然后开始注释掉更新

记录集的行,并继续注释掉更新行,直到你知道哪个是b
。例如:

logrs![UserName] =" Steve"

它爆炸了。评论

''logrs![UserName] =" Steve"

它并没有爆炸。这意味着表中的

UserName字段有问题,否则Steve不是有效值。


试验和错误可能是easies方法找出问题所在。



OK. You know the line. It is telling you there is a value it doesn''t
like...near as I can tell. I''ll assume you know how to step through
code. If not, click on the bar to the left of the AddNew line that puts
a dot on the bar and highlights the line. Now run the process. Check
the values of each item you are updating in the recordset.

ALso, copy the code and put into a module. Instead of plugging in the
values in the program, attempt to add with valid values. Ex:
logrs![UserName] = "Steve"
Do that for all fields. If you can''t add a record with
plugged-in-manually and the values are correct for the field, maybe you
have an existing record that conflicts with something.

When are you calling this? I had a main form that called some functions
and queries that used NZ() and otherthings like that. Once the form was
loaded the functions I was using could be used. But on the loading of
the form, the VBA functions were not available.

I doubt that is the case if you have been using this method for a while.
Check your data.

If you can add a record with manual data and the data looks ok when you
step through code, then start commenting out a line where you update the
recordset and keep commenting out an update line until you know which
one goofs up. Ex:
logrs![UserName] = "Steve"
and it blows up. Comment out
''logrs![UserName] = "Steve"
and it doesn''t blow up. That means there is something wrong with the
UserName field in the table or else Steve is not a valid value.

Trial and error may be the easies method to find out what is wrong.


这篇关于错误3220 - 表级别验证表达式中的表达式中无法使用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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