取决于2个字段的顺序编号不会添加 [英] Sequential number depending on 2 fields are not adding

查看:84
本文介绍了取决于2个字段的顺序编号不会添加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在这里添加连续的圈数。

如果添加了人的第一个racenumber,它会显示lapno = 1;


如果相同同一个人和racedate的人做第二圈然后lapno必须显示= 2


Mainform称为Racesetupf


子表格所在的子表单,被称为RaceTimingSF

表格和子表单通过RaceName字段链接。 Racename和Racedate都是独一无二的


字段:

Racedate =日期字段

racename = txtfield

Racenumber = txtfield

Racefinishtime = longdate


代码我在插入表单之前试过:

Me.LapNo = Nz (DMax(LapNo,RacetimingT,[RaceNumber] =''"& Me。[RaceNumber]&"''"),0)+ 1 ---用它做只有第一次套装


如果我在另一个日期举行另一场比赛,那么必须重新开始比赛,因为Racenumbers + lapno

请参阅随附的屏幕截图

对于Racenumber = 1在第一圈,lapno = 1

如果你再次输入Racenumber,那么lapno必须改为= 2等不同的racenumbers。这必须至少工作8圈

请帮助



I need to add sequential lap numbers here.
If person''s first racenumber is added, it shows lapno =1;

if same person in same Race and racedate do 2nd lap then lapno must show =2

Mainform is called Racesetupf

Subform where table is, is called RaceTimingSF
The Form and subform are linked via the RaceName field. The Racename and Racedate are both unique

Fields:
Racedate = date field
racename = txtfield
Racenumber = txtfield
Racefinishtime = longdate

code i tried in before insert of form:
Me.LapNo = Nz(DMax("LapNo", "RacetimingT", " [RaceNumber] = ''" & Me.[RaceNumber] & "''"), 0) + 1 --- do it with first lapno only

If i have another race on a different date, then process must start all over again for the Racenumbers + lapno
see attached screen capture pics
For Racenumber = 1 on the first lap the lapno = 1
if you enter Racenumber again, then lapno must change to = 2 etc for different racenumbers. This must work for at least 8 laps
pls help

附加文件
(49.5 KB,57 views)
Attached Files
(49.5 KB, 57 views)

推荐答案

我看待事物的方式比你指出的要复杂得多。我觉得比赛号码是解决方案的关键。如果用户在子表单中输入了比赛号码,则会根据之前的比赛号码进行检查。还必须检索种族名称,圈数和名称(实际的跑步者)的先前条目。如果比赛号码相同,则前一个比赛名称与当前比赛名称匹配,并且先前的名称(跑步者)与当前比赛名称匹配,则圈数可以递增1(+1)。如果种族编号不同,或种族名称不同,或名称不同,则必须将圈数重置为1.当然,实现此逻辑比描述它更复杂。
The way I see things are a little more complicated then what you indicate. I feel as though the Race Number is the Key to the solution. If the User enters a Race Number in the Sub-Form, it is checked against the previous Race Number. Prior entries for the Race Name, Lap Number, and Name (the actual Runner) must also be retrieved. If the Race Numbers are the same, the previous Race Name matches the current Race Name, and the prior Name (Runner) matches the current Name, then the Lap Number can be incremented by 1 (+1). If the Race Number is different, or the Race Name is different, or the Name is different, the Lap Number must be Reset to 1. Implementing this logic, of course, is a little more complicated than describing it.


听起来像我可能有问题;复杂?
sounds like i may have a problem; to complicated?


还没有。我可能仍然有你发给我的DB,如果我这样做的话,我会看一看,看看有什么可以做的。如果我没有它,我将请求另一个Access 2003格式的演示。我明天会发布一些东西,因为我整天都在工作。
Not yet. I may still have the DB you sent me, if I do then I''ll have a look and see what, if anything, can be done. If I do not have it, I''ll request another Demo in Access 2003 Format. I''ll post soemthing for sure tomorrow, since I am at work for the entire Day/Evening.


这篇关于取决于2个字段的顺序编号不会添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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