如何将序列号添加到两个记录集 [英] How to add sequential numbers to two recordsets

查看:81
本文介绍了如何将序列号添加到两个记录集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的我回来了关于记录集的问题。

我可以在同一时间向两个不同的记录集添加记录。(RacetimingT和RaceEntry5)


我的问题:我如何向两个记录集添加一个序列号,然后根据序列号将数据复制到这些记录集中的不同字段。


如果我第一次添加,它可以100%工作将数据转换为子表单,然后使用beforeupdate创建序列号,然后使用afterupdate打开记录集,并根据序列号将其复制到不同的字段。我更喜欢将记录集用于其他技术问题 - 请参阅代码。

我使用此代码将数据复制到2个记录集中并且工作原理

Ok i am back with a question about recordsets.
I can add a record to two different recordsets at the sametime.(RacetimingT and RaceEntry5)

My problem: how do i add a sequential number to both recordsets and then copy data to different fields in these recordsets based on the sequential number.

It works 100% if i first add the data to a subform and then use beforeupdate to create sequential number and afterupdate to open recordset and copy it to different fields based on the sequential no. I would prefer to use recordsets for other technical issues - see code.
I use this code to copy data into the 2 recordsets and it works

展开 | 选择 | Wrap | 行号

推荐答案

我对您的请求的确切性质感到非常困惑,但我会给它一个刺。以下代码将序列号添加到2个记录集([Seq]),并根据这些序列号在每个记录集([Result])中为字段添加唯一值。
I am very confused as to the exact nature of your Request, but I''ll give it a stab. The following Code will add Sequential Numbers to 2 Recordsets ([Seq]) as well as adding a Unique Value to a Field in each each Recordset ([Result]) based on those Sequential Numbers.
展开 | 选择 | Wrap | 行号


Thx adezi。很抱歉这样复杂化。


为了简化它:在racetimingT和RaceEntry5表(记录集)中,代码必须单独查看每个表中的多个字段然后添加基于当前raceate的LapNo字段(数字字段)的序号,以及racenumber和racenumber。两个中的字段(数字字段)。

因此在这个RacetimingT + RaceEntry5表中,你将拥有许多不同的赛道和racenumbers以及之前比赛中的lapno'。


它必须做什么 - 在RacetimingT中+ RaceEntry5记录集必须查看当前的racedate记录集。和当前的racenumber和当前的lapno字段,如果lapno字段,则= 0或空白然后它必须添加1或1。对于这个新的racedate和racenumber,当它被添加。如果lapno =1,则对于这些racedate和racenumber,字段,然后它必须使它2等等



这些相同的数据将根据添加的先前记录的标准添加到RacetimingT和RaceEntry5(表格)记录集中。


得出结论:

RaceTimingT + RaceEntry5 tables =" RaceNumber" +RaceDate+LapNo字段和顺序号转到Lapno字段。字段。
Thx adezi. Sorry for complicating it like this.

To simplify it: In ie the racetimingT and RaceEntry5 tables (recordsets), the code must look individually at multiple fields in each of these tables and then add a sequential number to the LapNo field (number field) based on the current "racedate", and the "racenumber" fields (number field) in both.
Thus in this RacetimingT + RaceEntry5 tables, you will have many different racedates and racenumbers and lapno''s from previous races.

What it must do - in the "RacetimingT" + RaceEntry5 recordsets it must look at the current "racedate" and current "racenumber" and the current "lapno" fields, and if the "lapno" = 0 or blank then it must add a "1" for this new racedate and racenumber when it gets added. If the lapno = "1" for these racedate and "racenumber" fields, then it must make it "2" etc etc
.
This same data will be added to both the RacetimingT and RaceEntry5 (tables) recordsets based on the criteria from previous records added.

to conclude:
RaceTimingT + RaceEntry5 tables = "RaceNumber" + "RaceDate"+ "LapNo" fields and the sequential number goes to the "Lapno" field.
展开 | 选择 | Wrap | 行号


  1. 是否存在链接这两张表之间的字段?如果是这样,它的名称和数据类型是什么?
  2. 这些表之间的关系究竟是什么?


这篇关于如何将序列号添加到两个记录集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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