本文介绍了错误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 SteveHiI have a really weird problem and any assistance would be welcome.I have developed an app in Access 2002. The app runs perfectly on thedevelopment machine. I have packaged the appusing the Microsoft XP Developer Packaging Wizard (Service Pack 1). The 1st3 releases of the app ran perfectly onsite.On Friday the 4th release of the app went out to a customer. The app openedperfectly but on clicking OK on my login formI get the error : 3220 - The functiom is not available in expression intable level validation expression.I took the 2 main files one mde file containing the application and an mdbfile containing the data which is linked into themde file from the support directory on the installation CD and copied themto a machine which has Office XP Professionalloaded (as I can not simulate the error on the box used for development). Ifound that when I went into a table that whenmanually entering a record I got the same error, the weird part is neitherthe table nor the code populating the tablehas changed since the 1st release of the app (In fact it is code I use for atable and module that I use in many otherapplications).The table layout is as follows :Key AutoNumber Primary KeyUserName Text(15) MandatoryNo Default ValueSecurityLevel Long Integer MandatoryDefault Value 0DBChanged Text(20) MandatoryNo Default ValueRecordChanged Text(100) MandatoryNo Default ValueDBAction Text(100) MandatoryNo Default ValueDateChanged Date/Time MandatoryDefault Value Date()TimeChanged Date/Time MandatoryDefault Value Time()TillNo IntegerDefault Value 0The code used to populate the table is as follows :Sub logchg(tbl As String, rec As Variant, action As String)Dim srec As StringDim logrs As Recordsetsrec = CStr(rec)Set logrs = db.OpenRecordset("tblLog")logrs.AddNewlogrs![UserName] = modGlobals.userlogrs![SecurityLevel] = modGlobals.SecurityLevellogrs![DbChanged] = tbllogrs![RecordChanged] = sreclogrs![DBAction] = actionlogrs![TillNo] = modGlobals.TillNologrs.Updatelogrs.CloseEnd SubThe call that causes the error is :Call modSecurity.logchg("N/A", "N/A", "LOGON")Can anyone explain why I get the error ?TIASteve推荐答案 我有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''tavailable in expressions. Your error has the addendum ofTableLevelValidation to my 2426.Open up your table tblLog. Do you have a validation rule on any of thefields you are updating? Maybe make a copy of the current log table andthen 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 thatblows up? IOW, step through code and locate which field you areupdating that is the cause of the problem. 我有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 codeseems to crash on :logrs.Updatewhich unfortunately tells me nothing.Steve 感谢您的回复,我没有设置验证规则,代码 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''tlike...near as I can tell. I''ll assume you know how to step throughcode. If not, click on the bar to the left of the AddNew line that putsa dot on the bar and highlights the line. Now run the process. Checkthe values of each item you are updating in the recordset.ALso, copy the code and put into a module. Instead of plugging in thevalues 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 withplugged-in-manually and the values are correct for the field, maybe youhave an existing record that conflicts with something.When are you calling this? I had a main form that called some functionsand queries that used NZ() and otherthings like that. Once the form wasloaded the functions I was using could be used. But on the loading ofthe 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 youstep through code, then start commenting out a line where you update therecordset and keep commenting out an update line until you know whichone 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 theUserName 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 - 表级别验证表达式中的表达式中无法使用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-06 12:49