473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Manifest retrieval database.

Hello everyone, this is my first post here and hopefully the first of many.

I have an issue with a database i'm trying to setup. I have manifests that I distribute out to drivers that do some Tech work for us and this database keeps all the locations, addresses, tech numbers, etc in order... Everything works fine except with a multi select list box.

The list box retrieves the information correctly into the report... The problem is that I want it to split the actual pages of the report into seperate pages by route.

There are several routes to one driver, but each page should be divided by its respective route name. Instead what it does, is merges all routes into the first route it picked up, so all stops would show under ROUTE 1 instead of being distributed to ROUTE 1, 2, 3 etc...

Below is the code for the command button that retrieves the selected items in the listbox...

Any help is appreciated. If you need the whole db let me know.

Expand|Select|Wrap|Line Numbers
  1. On Error GoTo Err_ReportManifest_Click
  2.  
  3.     Dim stDocName As String, stSelectedItems As Variant, stResult As String, iCounter As Integer, EmptyCheck As String
  4.     iCounter = 1
  5.  
  6. If List0.ItemsSelected.Count <> 0 Then
  7.     For Each stSelectedItems In List0.ItemsSelected
  8.     If iCounter < List0.ItemsSelected.Count Then
  9.     stResult = stResult & "'" & List0.ItemData(stSelectedItems) & "', "
  10.     iCounter = iCounter + 1
  11.     Else
  12.     stResult = stResult & "'" & List0.ItemData(stSelectedItems) & "'"
  13.     End If
  14.     Next stSelectedItems
  15. Else
  16.     MsgBox "Nothing was selected.", vbCritical + vbOKOnly
  17.     Exit Sub
  18. End If
  19.  
  20. MsgBox stResult
  21.  
  22.     stDocName = "Manifest"
  23.     DoCmd.OpenReport stDocName, acPreview
  24.  
  25. With Reports![Manifest]
  26.     .Filter = "TechQuery.Route IN (" & stResult & ")"
  27.     .FilterOn = True
  28. End With
  29.  
  30.  
  31. Exit_ReportManifest_Click:
  32.     Exit Sub
  33. Err_ReportManifest_Click:
  34.     MsgBox Err.Description
  35.     Resume Exit_ReportManifest_Click
  36.  
Oct 9 '07 #1
2 1460
Jim Doherty
897 Expert 512MB
Hello everyone, this is my first post here and hopefully the first of many.

I have an issue with a database i'm trying to setup. I have manifests that I distribute out to drivers that do some Tech work for us and this database keeps all the locations, addresses, tech numbers, etc in order... Everything works fine except with a multi select list box.

The list box retrieves the information correctly into the report... The problem is that I want it to split the actual pages of the report into seperate pages by route.

There are several routes to one driver, but each page should be divided by its respective route name. Instead what it does, is merges all routes into the first route it picked up, so all stops would show under ROUTE 1 instead of being distributed to ROUTE 1, 2, 3 etc...

Below is the code for the command button that retrieves the selected items in the listbox...

Any help is appreciated. If you need the whole db let me know.

Expand|Select|Wrap|Line Numbers
  1. On Error GoTo Err_ReportManifest_Click
  2.  
  3. Dim stDocName As String, stSelectedItems As Variant, stResult As String, iCounter As Integer, EmptyCheck As String
  4. iCounter = 1
  5.  
  6. If List0.ItemsSelected.Count <> 0 Then
  7. For Each stSelectedItems In List0.ItemsSelected
  8. If iCounter < List0.ItemsSelected.Count Then
  9. stResult = stResult & "'" & List0.ItemData(stSelectedItems) & "', "
  10. iCounter = iCounter + 1
  11. Else
  12. stResult = stResult & "'" & List0.ItemData(stSelectedItems) & "'"
  13. End If
  14. Next stSelectedItems
  15. Else
  16. MsgBox "Nothing was selected.", vbCritical + vbOKOnly
  17. Exit Sub
  18. End If
  19.  
  20. MsgBox stResult
  21.  
  22. stDocName = "Manifest"
  23. DoCmd.OpenReport stDocName, acPreview
  24.  
  25. With Reports![Manifest]
  26. .Filter = "TechQuery.Route IN (" & stResult & ")"
  27. .FilterOn = True
  28. End With
  29.  
  30.  
  31. Exit_ReportManifest_Click:
  32. Exit Sub
  33. Err_ReportManifest_Click:
  34. MsgBox Err.Description
  35. Resume Exit_ReportManifest_Click
  36.  

Have you looked at sorting and grouping in your report?

Jim
Oct 9 '07 #2
nico5038
3,080 Expert 2GB
I concur to Jim's remark, but wanted to add that all sorting for a report is done in the grouping menu (Press the [= looking Grouping button).
The ORDER BY in a report query won't have any effect !

Nic;o)
Oct 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: hawat.thufir | last post by:
an ant build.xml file: <project name="XHTML" default="package2"> <import file="properties.xml" /> <target name="clean"> <delete dir="${outputDir}" /> </target>
1
by: Santhu | last post by:
What is the difference between METADATA and MANIFEST and where do they get stored? Thank you
0
by: mb | last post by:
Hi I am working on a small helper tool to our main application. The tool uses SQLDMO to connect to the SQL Server 2000 database and allows us to cofigure the users who are allowed to use our...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
12
by: grace | last post by:
i am wondering why my database retrieval becomes too slow...we set up a new server (ubuntu, breezy badger) machine where we transferred all our files from the old server.. Our new server uses Asus...
0
by: JosAH | last post by:
Greetings, Introduction At the end of the last Compiler article part I stated that I wanted to write about text processing. I had no idea what exactly to talk about; until my wife commanded...
0
by: JosAH | last post by:
Greetings, Introduction Last week I was a bit too busy to cook up this part of the article series; sorry for that. This article part wraps up the Text Processing article series. The ...
9
by: Peter Duniho | last post by:
Is there a straightfoward API in .NET that allows for inspection of a database? That is, to look at the structure of the database, without knowing anything in advance about it? For example,...
25
by: zmickle | last post by:
Excuse my noobness. I am managing an access database that is shared by 4 users. Management does not want to use any technologies outside of access for this application (no SQL Server, etc). I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.