使用VB 2005计算MS Access表中的记录数 [英] Counting the no of records in a MS Access table using VB 2005

查看:64
本文介绍了使用VB 2005计算MS Access表中的记录数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个使用MS Access记录的计数器.我将解释如何
我要那个柜台工作.

我需要创建一个从0开始初始化的计数器.但是在那之后,该计数器应该
检查最后输入的学生ID,并从此开始计数.这将
帮助我使用MS中的文本数据类型创建自动发票编号字段
访问数据库!

I want to create a counter that uses the MS Access records. I am going to explain how
I want that counter works.

I need to make a counter that initialize from 0. But after that the counter should
check the last entered Student ID and start counting starting from that. This will
help me to create an automated invoice numbering field using text data type in MS
Access database!

推荐答案

我不确定我是否理解.您是否看过使用 AUTOINCREMENT [
I''m not sure if I understand. Have you looked at using AUTOINCREMENT[^]? You can change the starting value if needed, but I''m not sure that''s what you''re looking for.


使用静态变量可以很容易地做到这一点!

Using static variables this can do easily!

Dim Static intCVal as New Integer
Dim intTotVal as New Integer
Dim intVal as New Integer

intTotVal = intCVal + intVal


如果学生人数众多,那么很难对所要计算的内容感到困难,然后从表中选择count(*)
Very diffical to undestant what you are trying to count if number of students then you select count(*) from table


这篇关于使用VB 2005计算MS Access表中的记录数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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