Playback starts YouTube’s embedded player (privacy-enhanced mode).
how to add row numbers (record counting) to access query field
ChannelThe-Good-FoxDescription from the creator
how to add row numbers field in access database query
the code :
'copy this code as it is
'#################################
Private lngRowNumber As Long
Private colPrimaryKeys As VBA.Collection
Public Function ResetRowNumber() As Boolean
Set colPrimaryKeys = New VBA.Collection
lngRowNumber = 0
ResetRowNumber = True
End Function
Public Function RowNumber(UniqueKeyVariant As Variant) As Long
Dim lngTemp As Long
On Error Resume Next
lngTemp = colPrimaryKeys(CStr(UniqueKeyVariant))
If Err.Number Then
lngRowNumber = lngRowNumber + 1
colPrimaryKeys.Add lngRowNumber, CStr(UniqueKeyVariant)
lngTemp = lngRowNumber
End If
RowNumber = lngTemp
End Function
'################################
'ps: this code is not mine but after a lot research this worked
'so thanks for the original owner of the code
Edit 09-Oct-2017:
it is essential to add ORDER BY SomeColumn; to the SQL statement so that the rows are in order correctly
the code :
'copy this code as it is
'#################################
Private lngRowNumber As Long
Private colPrimaryKeys As VBA.Collection
Public Function ResetRowNumber() As Boolean
Set colPrimaryKeys = New VBA.Collection
lngRowNumber = 0
ResetRowNumber = True
End Function
Public Function RowNumber(UniqueKeyVariant As Variant) As Long
Dim lngTemp As Long
On Error Resume Next
lngTemp = colPrimaryKeys(CStr(UniqueKeyVariant))
If Err.Number Then
lngRowNumber = lngRowNumber + 1
colPrimaryKeys.Add lngRowNumber, CStr(UniqueKeyVariant)
lngTemp = lngRowNumber
End If
RowNumber = lngTemp
End Function
'################################
'ps: this code is not mine but after a lot research this worked
'so thanks for the original owner of the code
Edit 09-Oct-2017:
it is essential to add ORDER BY SomeColumn; to the SQL statement so that the rows are in order correctly
About this tutorial
The-Good-Fox published this 3:38 video tutorial on November 15, 2017. It has been watched 29,435 times on YouTube.
- Channel
- The-Good-Fox
- Category
- Education
- Duration
- 3:38
- Published
- November 15, 2017
- Views
- 29,435
- Likes
- 162
Tags
Share
This tutorial in other languages
- FRcomment ajouter des numéros de ligne (comptage enregistrement) au champ de requête d'accès
- EScómo agregar números de fila (registro) de conteo de campo de consulta de acceso
- PTcomo adicionar números de linha (contando registro) para campo de consulta acesso
- ITcome aggiungere numeri di riga (record) conteggio di accesso campo query
- DEwie Zeilennummern (Satzzählung) den Zugriff auf Abfragefeld hinzufügen
- NLhoe rijnummers (opnemen tellen) toe te voegen aan de toegang queryveld
- RUкак добавить номера строк (запись подсчета) в поле запроса доступа
- PLJak dodać numery wiersz (rekord) do liczenia polu zapytania dostępu
- JAアクセスクエリフィールドに行番号(レコードカウント)を追加する方法
- ARكيفية إضافة أرقام الصفوف (عد قياسي) للوصول إلى الحقل الاستعلام
- HIकैसे पहुँच क्वेरी क्षेत्र के लिए पंक्ति संख्या (रिकॉर्ड बढ़ रहा है) को जोड़ने के लिए
- IDcara menambahkan nomor baris (record terus bertambah) untuk mengakses lapangan permintaan