按顺序选择下一个数字 Access 2010 [英] Pick next number in sequence Access 2010

查看:43
本文介绍了按顺序选择下一个数字 Access 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须创建一个新的交易表 (tblTransactions),这样我才能根据借方(即发票)和贷方(即付款)字段找到帐户余额.该表包含一个字段,我在其中输入了所有现有的发票编号.

I had to create a new transaction table (tblTransactions) so I could find account balances based on the Debit(i.e. invoices) and credits(i.e. payments) fields. The table contains a field where I entered all the existing invoice numbers.

为了开始记录新交易,我创建了一个表单 (frmTransactions).创建新发票时,我希望表单 [Invoice #] 字段查看交易表 [Invoice] 字段列并找到最大值和 + 1.基本上,自动生成序列中的下一个数字.

To start logging the new transactions, I created a form (frmTransactions). When I create a new invoice, I want the forms [Invoice #] field to look at Transaction table [Invoice] field column and find the highest value and + 1. Basically, auto generating the next number in the sequence.

推荐答案

你可以简单地在 BeforeInsert 事件中使用:

You can simply use in the BeforeInsert event:

Me!Invoice.Value = DMax("Invoice", "tblTransactions") + 1

这篇关于按顺序选择下一个数字 Access 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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