Home  Fees/Services  Access 2010 Template  Access Tutorial  Access Download  Articles  Search  Contact  Privacy  Links

Increment Record Counter in Query

Open Email Using SendObject Access Download

User Inactivity Logout VBA Code

Disable Shift Key Demo

Send Email Microsoft Access Tutorial Download (Advanced)

Sequential Counter in Query

Multi Select List Box Query Parameters

Row Level Data Security

Programming MS Access Security Alternative

Single User Inventory Calculations Download

How To Perform Multi-User Inventory Calculations

Make Dependent Combo Box Code MS Access Tutorial

Union Query Example (Simple)

Union Query (Advanced) Access Tutorial

How To Fill Fields From Combo Box

Use Global Variables as Parameters

Continuous Form Dependent Combo Box

How To Program Continuous-Continuous Master/Detail Forms

Access Bar Chart / Bar Graph

Programming Crosstab Query Example

TransferText & OutputTo Microsoft Access

DoCmd.OpenForm & OpenArgs VBA Example

Running Sum Query Method

Choose Command Dynamic SQL Order By

Access Conditional Format

Access Report Banding

Popup Form Control Method

Sequential Counter Query Example

The sequential counter query example demonstrates a simple method to add a sequential number to every record in the query result. This example goes one step further and resets the increment when the Category field changes. See the query called Q_Increment. This query adds records to the T_Query_Results table. The record from T_Query_Results are displayed in the form below. Every time this form is opened the records are regenerated.

Microsoft Access is a fully capable database and it's primary limitations is the number of concurrent users it will support. Generally, we recommend a limit of 10 to 15 users.

Did you know you don't need to move to SQL/Server to run and manage your Access database on the net. There are many alternative solutions. Among them are Amazon's AWS cloud services and various hosting services in nearly every state.

Also see the VBA module call to module named VB_Functions. There you'll find the established of global variables and the vb function the performs the increment. The function is called from within the Q_Increment query.  The example uses an append query into a table so that the increment values don't change when Access refreshes the data every so many seconds.  The feature of Access can probably be turned off but I haven't found where to do it.  So, you need to place the results in a table or directly into a report to prevent the incremental value changing. Sequential Counter Query

Here is the globals module code containing the global variable declaration, the initialization of the increment variable, and the function which continuously increments until the Category field changes.

Option Compare Database

Global GBL_Category As String
Global GBL_Icount As Long

Public Function increment(ivalue As String) As Long

If Nz(GBL_Category, "zzzzzzzz") = ivalue Then
        GBL_Icount = GBL_Icount + 1
        GBL_Category = ivalue
        GBL_Icount = 1
End If
increment = GBL_Icount
End Function


Here is the link to download the Access Sequential Number Query Example

A Blue Claw Software Design Template:

HOA Software Template

A Blue Claw Database Design Article:

Microsoft Access On The Internet

Blue Claw Database Design Downloadable Tutorial:
Union Query Example (Simple)  

Here is a randomly selected programming tutorial:

DoCmd AddMenu

Microsoft Office:
MS Access 2003
Access 2007
Access 2010
Access 2013
Access 2016
Updated On 2/10/2018 2:53:28 AM

Contact Information

Copyright 2000-2018 Blue Claw Database Design

MS Access 2013, Access 2010 & Microsoft Office 2007