错误3061.参数太少,预计1运行一个函数。 [英] Error 3061. Too few parameters, expected 1 running a function.

查看:82
本文介绍了错误3061.参数太少,预计1运行一个函数。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一个函数来修改表中的一些数据。


基本上我有一个名字列表和一个包含T或F的州列。我按名称排序,每个名称的最后一个状态应该是F.该函数首先在记录集中对名称进行分组,然后如果上面记录的状态是相同的(如在2个连续的T'中),它应该是删除它。否则,它应退出该功能。


这是迄今为止的功能

展开 | 选择 | 换行 | 行号

解决方案

Gareth,


我认为您需要做的是建立另一个变量来保存您尝试在If中评估的值......然后在第27行。否则,你的代码永远不会被评估为真(因为它是写的)。


而不是为TimeStamp设置变量(你从不使用,有一个State1的变量。然后比较下一条记录的的状态1与该变量的值。


我认为应该让你在正确的方向前进。
的答复感谢。我是否正确地说我需要将第24行中的时间戳替换为state1,以便它读取

展开 | 选择 | Wrap | 行号


嗯,你的几个问题代码(特别是第27行)。


首先,我不知道什么类型的数据State1是。让我们 假设 一个整数,用于下面的代码重写(但请根据实际数据的要求进行修改):

展开 | 选择 | Wrap | 行号


Hi all,

I have a function in order to amend some data in a table.

Basically I have a list of names and a state column with T or F in it. I have sorted by name and the last state for each name should be F. The function groups the names first in a recordset, and then if the state for the record above is the same (as in 2 consecutive T''s) it should delete it. Otherwise, it should exit the function.

Here is the function so far

Expand|Select|Wrap|Line Numbers

解决方案

Gareth,

I think what you need to do is establish another variable to hold the values you are trying to evaluate in your If...Then in Line 27. Otherwise, your code will never evaluate as true (as it is written).

Instead of setting a varaible for the TimeStamp (which you never use, have a variable for State1. Then compare the next record''s value for State1 with that variable.

I think that should get you moving in the right direction.


Thanks for replying. Am I right in saying I need to replace timestamp in line 24 with state1 so that it reads

Expand|Select|Wrap|Line Numbers


Well, there are several issues with your code (particularly line 27).

First, I don''t know what type of data "State1" is. Let''s assume an integer for the following re-do of your code (but please modify as required for your actual data):

Expand|Select|Wrap|Line Numbers


这篇关于错误3061.参数太少,预计1运行一个函数。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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