How to Use For Next Loops in MS Access VBA

  Рет қаралды 4,639

Sean MacKenzie Data Engineering

Sean MacKenzie Data Engineering

Күн бұрын

Пікірлер: 17
@seanmackenziedataengineering
@seanmackenziedataengineering 3 жыл бұрын
Who is using For.. Next for the first time? Go for it!
@imstevemcqueen
@imstevemcqueen 3 жыл бұрын
Great examples as always with Sean
@seanmackenziedataengineering
@seanmackenziedataengineering 3 жыл бұрын
Thanks!
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
RsData is at 11:20
@ballaomer6738
@ballaomer6738 Жыл бұрын
please make a video to use for next loop with fields in continous forms to display all data in ms access actually needed ... regards
@seanmackenziedataengineering
@seanmackenziedataengineering Жыл бұрын
Why don't you just set the RecordSource of the form to your table? It will display all the records. What you describe with For.. Next is not really a good way to do it. An alternative for some cases is to just make a temp table, then open your continuous form with that as the RecordSource.
@mehdibakhtiari300
@mehdibakhtiari300 5 ай бұрын
Mr MacKenzie, RsData(StrSql, false) causes a compile error.
@seanmackenziedataengineering
@seanmackenziedataengineering 5 ай бұрын
That's because you will need that custom function. You can put this in your module to use it: Function RsData(strSQL, blnFieldNames) '**************************************************************** '*** Returns a simple array based on a recordset '**************************************************************** Dim db As Database Dim rstA As DAO.Recordset Dim arRs, lngRec Dim lngX, lngY, lngCol lngY = 255 lngRec = 0 Set db = CurrentDb Set rstA = db.OpenRecordset(strSQL, dbOpenSnapshot) lngX = rstA.Fields.Count ReDim arRs(lngX, lngY) If blnFieldNames Then lngRec = 1 For lngCol = 0 To lngX - 1 arRs(lngCol, 0) = rstA(lngCol).Name Next End If If rstA.EOF = False Then Do Until rstA.EOF For lngCol = 0 To lngX - 1 arRs(lngCol, lngRec) = rstA(lngCol) Next rstA.MoveNext lngRec = lngRec + 1 If lngRec > lngY Then lngY = lngY + 256 ReDim Preserve arRs(lngX, lngY) End If Loop ReDim Preserve arRs(lngX, lngRec) End If rstA.Close Set rstA = Nothing RsData = arRs End Function
@arumugamramu645
@arumugamramu645 3 жыл бұрын
Pls help me, how to create the school student, classes wise strength Page report on ms access
@seanmackenziedataengineering
@seanmackenziedataengineering 3 жыл бұрын
Thanks for your email! I'm not sure what you mean; could you tell me more?
@arumugamramu645
@arumugamramu645 3 жыл бұрын
Pivot table type, we need page report. (Filter : Active and inactive) student strength report. Pls send me template
@mshahneelsajid147
@mshahneelsajid147 2 жыл бұрын
I want to concatenate multiple rows id wise plz help me to achieve it
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
You would like to concatenate ID numbers from several rows? You can do that by opening a query with your ID numbers, then concatenate them in a string as you loop through. kzbin.info/www/bejne/bXnGnIygfcSqnZY
@mehdibakhtiari300
@mehdibakhtiari300 6 ай бұрын
Hoi , compile error with RsDate. What is the reason?
@seanmackenziedataengineering
@seanmackenziedataengineering 6 ай бұрын
It is probably RsData, not RsDate (the a at the end) 🛠
@gerfer6261
@gerfer6261 2 жыл бұрын
😀
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
Thanks!
How to Use Global Variables in Microsoft Access VBA
13:25
Sean MacKenzie Data Engineering
Рет қаралды 9 М.
How to Use Class Modules in Microsoft Access
26:35
Sean MacKenzie Data Engineering
Рет қаралды 2,2 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
How to Add a Row Number to your Query in Microsoft Access
11:12
Sean MacKenzie Data Engineering
Рет қаралды 1,8 М.
How to Use Inline Queries in Microsoft Access
14:27
Sean MacKenzie Data Engineering
Рет қаралды 1 М.
How to Make a Combination Query in Microsoft Access
21:19
Sean MacKenzie Data Engineering
Рет қаралды 1,3 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 246 М.
How to Store Files in Microsoft Access
20:41
Sean MacKenzie Data Engineering
Рет қаралды 1,7 М.
DEEPSEEK Vs CHATGPT There Is A  Clear Winner !!
15:53
Rick Aqua
Рет қаралды 17 М.
How to Use Streamlit with Microsoft Access
24:34
Sean MacKenzie Data Engineering
Рет қаралды 1,8 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН