01-15-2019, 08:03 AM
|
#1
|
Newly Registered User
Join Date: Mar 2018
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
|
Arranging exam register number data in zigzag order in ms access report
Sir
My access report contains exam register numbers in 4 columns and I would like to arrange it in zigzag order as given below
120321 120322 120323 120324
120328 120327 120326 120325
120329 120330 120331 120332
Please Help
Thanks
|
|
|
01-15-2019, 08:11 AM
|
#2
|
Newly Registered User
Join Date: Apr 2015
Location: KY,USA
Posts: 3,240
Thanks: 0
Thanked 711 Times in 696 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
Don't know about zigzag,but in report page setup,
page setup, columns, either:
down, then across,
across, then down (aka zigzag?)
|
|
|
01-15-2019, 08:11 AM
|
#3
|
Have been here a while
Join Date: Jun 2012
Location: In the south of Denmark (Jutland), near the German border.
Posts: 7,550
Thanks: 2
Thanked 2,020 Times in 1,976 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
I don't think you can made it without involving some VBA code that set a sort order, then it is not exactly zigzag order, but Ascending for four values then Descending for four values then again Ascending for four values etc.
__________________
If the above post has helped you, why not take the time to say thank you, by pressing the "Thumbs up."
|
|
|
01-15-2019, 08:29 AM
|
#4
|
Newly Registered User
Join Date: Mar 2018
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
sir, a single page contains eighty register numbers , it should be arranged like this
first row from left to right
second row from right to left
third row from left to right etc
each row contains 4 register numbers
|
|
|
01-15-2019, 08:35 AM
|
#5
|
Have been here a while
Join Date: Jun 2012
Location: In the south of Denmark (Jutland), near the German border.
Posts: 7,550
Thanks: 2
Thanked 2,020 Times in 1,976 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
Quote:
Originally Posted by vsk1975
..
first row from left to right
second row from right to left
third row from left to right etc
each row contains 4 register numbers
|
Exactly what I wrote, still I don't think you can made it without involving some VBA code that set a sort order.
Post your database, zip it!
__________________
If the above post has helped you, why not take the time to say thank you, by pressing the "Thumbs up."
|
|
|
01-15-2019, 09:15 AM
|
#6
|
Newly Registered User
Join Date: Mar 2018
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
sir here is the zipped file . It is a simple db file please give a solution
thanks
|
|
|
01-15-2019, 10:53 AM
|
#7
|
Nifty Access Guy
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,683
Thanks: 393
Thanked 814 Times in 777 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
I'm not sure this is the answer you are looking for, but it might provide some inspiration...
http://www.niftyaccess.com/reports-weaving-records/
Sent from my SM-G925F using Tapatalk
__________________
Code:
|||||
@(~Ô^Ô~)@
-------------oOo---U---oOo-------------
| |
| Uncle Gizmo |
| |
| |
| Get $20 worth of "Nifty Code" |
| To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
| Ooo |
|_________________ooO____( )________|
( ) ) /
\ ( (_/
\_)
|
|
|
01-15-2019, 11:24 AM
|
#8
|
Super Moderator
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 11,728
Thanks: 63
Thanked 1,920 Times in 1,870 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
The term you are looking for if I recall correctly is "snaking". I recall doing this with labels.
Here is one link, but I'm sure you can google others and/or a tutorial.
Another link
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Last edited by jdraw; 01-15-2019 at 11:53 AM.
|
|
|
01-15-2019, 11:37 AM
|
#9
|
Newly Registered User
Join Date: May 2018
Location: USA baby
Posts: 1,177
Thanks: 22
Thanked 311 Times in 302 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
Quote:
Exactly what I wrote, still I don't think you can made it without involving some VBA code that set a sort order.
Post your database, zip it!
|
I think that is how I would do it. Add a sort column to the table. Determine you number of columns and number the columns. Then show in a columnar report.
|
|
|
01-15-2019, 11:49 AM
|
#10
|
Super Moderator
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 11,728
Thanks: 63
Thanked 1,920 Times in 1,870 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
Here's what I get with your data using 4 columns with snaking (across then down). Hope that's what you want.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
01-15-2019, 12:10 PM
|
#11
|
Newly Registered User
Join Date: May 2018
Location: USA baby
Posts: 1,177
Thanks: 22
Thanked 311 Times in 302 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
Add a field sort order to your table and run the code I get the below if I sort by sortorder.
Code:
120321 120322 120323 120324
120328 120327 120326 120325
120329 120330 120331 120332
Code:
Public Sub AddSort(NumberColumns As Integer)
Dim rs As DAO.Recordset
Dim strSql As String
Dim i As Integer
Dim rowCountDiv As Double
Dim rowcount As Integer
Dim direction As Integer
Dim sortOrder As Integer
Dim itmInRow As Integer
Set rs = CurrentDb.OpenRecordset("Select * from table1 order by regno")
direction = 1 ' 1 forward 0 backward
Do While Not rs.EOF
rowCountDiv = (rs.AbsolutePosition) / NumberColumns
If rowCountDiv = Int(rowCountDiv) Then
rowcount = rowcount + 1
itmInRow = 0
direction = rowcount Mod 2
End If
If direction = 1 Then
sortOrder = rs.AbsolutePosition + 1
Else
sortOrder = (rowcount * NumberColumns) - itmInRow
End If
Debug.Print rs.AbsolutePosition + 1 & " " & rowcount & " Mod " & rowcount Mod 2 & " " & sortOrder
itmInRow = itmInRow + 1
rs.Edit
rs!sortOrder = sortOrder
rs.Update
rs.MoveNext
Loop
End Sub
Public Sub TestCount()
AddSort 4
End Sub
|
|
|
The Following User Says Thank You to MajP For This Useful Post:
|
|
01-15-2019, 12:18 PM
|
#12
|
Newly Registered User
Join Date: May 2018
Location: USA baby
Posts: 1,177
Thanks: 22
Thanked 311 Times in 302 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
Example sort order
Code:
regno sortOrder
120321 1
120322 2
120323 3
120324 4
120325 8
120326 7
120327 6
120328 5
120329 9
120330 10
120331 11
120332 12
120333 16
120334 15
120335 14
120336 13
120337 17
120338 18
120339 19
120340 20
120341 24
120342 23
120343 22
120344 21
120345 25
120346 26
120347 27
120348 28
120349 32
120350 31
120351 30
120352 29
Last edited by MajP; 01-15-2019 at 07:49 PM.
|
|
|
01-16-2019, 08:40 AM
|
#13
|
Newly Registered User
Join Date: Mar 2018
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
|
Re: Arranging exam register number data in zigzag order in ms access report
Many Many Thanks Sir
The Given Code Works Perfectly
|
|
|
Thread Tools |
|
Display Modes |
Rate This Thread |
Linear Mode
|
|
All times are GMT -8. The time now is 12:22 PM.
|
|