帮助操纵表中的记录 [英] Help manipulating records in a table

查看:61
本文介绍了帮助操纵表中的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于[table1]的表格。 [table1]中只有一个字段称为"Bet"。数据库中有一个名为[Table2]的第二个表,它只有一个字段"Counter"。

I have a form based on [table1]. There is only one field in [table1] called "Bet". There is a second table in the database called [Table2] which has only one field "Counter".

表单上有三个命令按钮。

There are three Command Buttons on the form.

点击"CommandButton1"时应该发生以下情况:

When clicking "CommandButton1" the following should happen:

1)如果[table2]中没有记录,则创建3个新记录,每个记录的编号为"5"。在字段"Counter。

1) If there are no records in [table2], then create 3 new records, each record having the number "5" in the field "Counter.

2)如果[table2]中有一条记录,则"Bet" (基于[table1]的表格上的字段)应设置为等于"计数器"中的数字。在[table2]的记录中。

3)如果[table2]中有两个或更多记录,则"Bet"应设置为"计数器"的总和。在[table2] Plus的记录#1中"" Counter"在[table2]的最后一条记录中。

2) If there is one record in [table2], then "Bet" (the field on the form based on [table1]) should be set to equal the number in "Counter" in the record in [table2].
3) If there are two or more records in [table2], then "Bet" should be set to the sum of "Counter" in record #1 of [table2] Plus "Counter" in the last record of [table2] .

点击"CommandButton2"时应该发生以下情况:

When clicking "CommandButton2" the following should happen:

在[table2]中添加一条新记录,其中字段为"Counter"。 ="投注"来自表格。

Add a new record to [table2] where the field "Counter" = "Bet" from the form.

点击"CommandButton3"时应该发生以下情况:

When clicking "CommandButton3" the following should happen:

1)如果[table2]中只有一条记录,则删除该记录

1) If there is only one record in [table2], delete that record

2)如果有两条或者[table2]中的更多记录,删除[table2]中的最后和第一条记录。

2) If there are two or more records in [table2], delete the last and the first records in [table2].

感谢您的帮助。

标记

推荐答案

嗨Mark,

不幸的是,Access表不以任何特定顺序存储记录。所以,当你说"第一次"时,和"最后",您必须在表中添加工具以帮助Access确定记录顺序。表
中只有一个字段可能还不够。

Unfortunately, Access tables don't store records in any particular order. So, when you say "first" and "last," you will have to add a facility in your table to help Access determine the record order. Having only one field in the table may not be enough.

只需2美分......

Just my 2 cents...


这篇关于帮助操纵表中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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