为什么我的代码有效 - 但有时只有 [英] Why does my Code Work - but Only Sometimes

查看:76
本文介绍了为什么我的代码有效 - 但有时只有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

**这个帖子是从一个相关的线程中拆分的如何基于访问中相同字段中的先前记录添加1分钟


我现在在这里遇到了一个问题

在第一次双击时,它会增加1分钟,但是当我点击下一行时,而不是在前一次添加1分钟时,它会显示无效使用空

展开 | 选择 | Wrap | 行号

解决方案
Neopa。此代码现在仅基于第一行数据工作,然后在第二行内部的timestart字段内双击时,它将正确地向第二行数据添加1分钟。


如果我即在第2行添加初始日期/时间并在第3行中双击,然后它将使我无效使用null错误。这发生在第一行下面的每隔一行。


请在有空的时候帮忙


我希望它有意义


Neels是有道理的。在您提出问题之前,这似乎是您遇到的问题。为了提供帮助,我需要你提供更多信息。


看来问题是你的代码第6行引用[RaceEntryID](不是字符串中的引用但是之后的那个 - 之后有1个)。我猜它是Form控件的名称,但我根本不知道它。它最初出现了你的问题,我只是简单地用它来询问你的问题。


很明显,你可以期望在附加的示例图片中将其设置为3,但实际上它根本没有设定。如果你可以告诉我它以及它的设置和发现位置,那么我可以帮助你解决这个问题。如果由于任何原因这是不可能的,我们可能会使用 DMax(),但我需要更多地了解您的数据如何存储和分组,以便能够为您做到这一点。如果可以的话,前一个解决方案会更简洁,更合适。


简单说明

我按一个按钮,当前时间用msec是添加到timestart中现场 - 这个工作100%


当我2x点击这一行下方的一行时,它会增加1分钟到上面的整体时间。这个工作正常。

什么时候我进入3d行并在其中点击2次,它现在产生此错误。

mainform = racesetupttsf

subform = RaceTimingTTSF1

字段= timestart

table = racEntry

raceentryid。


我想我知道问题是什么 - raceentryfield按字母顺序排序也许它无法找到下一个记录。

我今晚会检查它是否有效,当它没有排序


** This thread was split from a related thread how to add 1 minute based on previous record in same field in access **

I developed a problem here now
On the first double click, it adds the 1 min, but when i click in the next row, instead of adding 1 minute onto the previous time, it shows "Invalid use of Null"

Expand|Select|Wrap|Line Numbers

解决方案

Neopa. this code only works now based on the first row of data and then it will correctly add 1 min to the 2nd row data, when double clicking inside timestart field in 2nd row.

If i ie add the initial date/time in maybe row 2 and doubleclick in ie row 3, then it will give me the invalid use of null error.This happens in every other row below the first one.

Pls assist when u have time

I hope it makes sense


It makes sense Neels. It seems this is a problem that you started with before you even asked the question. To help, I need some more info from you.

It appears the problem is with the reference on line #6 of your code to [RaceEntryID] (Not the reference within the string but the one afterwards that has - 1 after it). I would guess that it is the name of a Form control, but I have no real knowledge of it at all. It came with your question originally and I simply used it consistently with how your question was asked.

It seems clear that you would expect this to be set at three in the attached example picture, but that actually it''s not even set at all. If you can tell me about it and where it''s set and found then I may be able to help you get around the issue. If that''s not possible for any reason we could probably use DMax() instead, but I''d need more understanding of how your data is stored and grouped to be able to do that for you. The former solution would be a neater and more appropriate one though if we can.


To put it simple
I press a button and the current time with msec is added to the "timestart" field -this workds 100%

When i 2x click one row below this, it adds 1 minute to the above overall time.this works fine.
When i go to the 3d row and 2x click inside it, it now produces this error.
The mainform = racesetupttsf
subform = RaceTimingTTSF1
field = timestart
table = racEntry
raceentryid.

I think i have an idea what problem is - the raceentryfield is sorted alphabetically and perhaps it cant find the next record.
I will check tonight if it works when its not sorted


这篇关于为什么我的代码有效 - 但有时只有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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