473,485 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calling Temporary reports in List Box of Reports

78 New Member
I have created a form for listing my reports using tips and code from Allen Browne's website. The Code is as Follows:
Expand|Select|Wrap|Line Numbers
  1.  Function EnumReports(fld As Control, id As Variant, row As Variant, col As Variant, code As Variant) As Variant
  2.     ' Purpose:  Supplies the name of all saved reports to a list box.
  3.     ' Usage:    Set the list box's RowSourceType property to:? EnumReports
  4.     '               leaving its RowSource property blank.
  5.     ' Notes:    All arguments are provided to the function automatically.
  6.     ' Author:   Allen Browne        allen@allenbrowne.com    Feb.'97.
  7.  
  8.     Dim db As Database, dox As Documents, i As Integer
  9.     Static sRptName(255) As String              ' Array to store report names.
  10.     Static iRptCount As Integer                 ' Number of saved reports.
  11.  
  12.     ' Respond to the supplied value of "code".
  13.     Select Case code
  14.         Case acLBInitialize                     ' Called once when form opens.
  15.             Set db = CurrentDb()
  16.             Set dox = db.Containers!Reports.Documents
  17.             iRptCount = dox.Count               ' Remember number of reports.
  18.             For i = 0 To iRptCount - 1
  19.                 sRptName(i) = dox(i).Name       ' Load report names into array.
  20.             Next
  21.             EnumReports = True
  22.         Case acLBOpen
  23.             EnumReports = Timer                 ' Return a unique identifier.
  24.         Case acLBGetRowCount                    ' Number of rows
  25.             EnumReports = iRptCount
  26.         Case acLBGetColumnCount                 ' 1 column
  27.             EnumReports = 1
  28.         Case acLBGetColumnWidth                 ' 2 inches
  29.             EnumReports = 2 * 1440
  30.         Case acLBGetValue                       ' The report name from the array.
  31.             EnumReports = sRptName(row)
  32.         Case acLBEnd
  33.             Erase sRptName                      ' Deallocate array.
  34.             iRptCount = 0
  35.     End Select
  36. End Function 
How do I keep this from listing "~TMP*" repoorts?
Dec 12 '06 #1
1 1709
ADezii
8,834 Recognized Expert Expert
I have created a form for listing my reports using tips and code from Allen Browne's website. The Code is as Follows:
Expand|Select|Wrap|Line Numbers
  1.  Function EnumReports(fld As Control, id As Variant, row As Variant, col As Variant, code As Variant) As Variant
  2.     ' Purpose:  Supplies the name of all saved reports to a list box.
  3.     ' Usage:    Set the list box's RowSourceType property to:? EnumReports
  4.     '               leaving its RowSource property blank.
  5.     ' Notes:    All arguments are provided to the function automatically.
  6.     ' Author:   Allen Browne        allen@allenbrowne.com    Feb.'97.
  7.  
  8.     Dim db As Database, dox As Documents, i As Integer
  9.     Static sRptName(255) As String              ' Array to store report names.
  10.     Static iRptCount As Integer                 ' Number of saved reports.
  11.  
  12.     ' Respond to the supplied value of "code".
  13.     Select Case code
  14.         Case acLBInitialize                     ' Called once when form opens.
  15.             Set db = CurrentDb()
  16.             Set dox = db.Containers!Reports.Documents
  17.             iRptCount = dox.Count               ' Remember number of reports.
  18.             For i = 0 To iRptCount - 1
  19.                 sRptName(i) = dox(i).Name       ' Load report names into array.
  20.             Next
  21.             EnumReports = True
  22.         Case acLBOpen
  23.             EnumReports = Timer                 ' Return a unique identifier.
  24.         Case acLBGetRowCount                    ' Number of rows
  25.             EnumReports = iRptCount
  26.         Case acLBGetColumnCount                 ' 1 column
  27.             EnumReports = 1
  28.         Case acLBGetColumnWidth                 ' 2 inches
  29.             EnumReports = 2 * 1440
  30.         Case acLBGetValue                       ' The report name from the array.
  31.             EnumReports = sRptName(row)
  32.         Case acLBEnd
  33.             Erase sRptName                      ' Deallocate array.
  34.             iRptCount = 0
  35.     End Select
  36. End Function 
How do I keep this from listing "~TMP*" repoorts?
'I've returned a sub-set of your code with changes indicated by a *. It was
'tested on my PC and works fine. Hope this helps you...

Expand|Select|Wrap|Line Numbers
  1. * Dim T As Integer                            'New Array Index to prevent "Holes"
  2.  
  3.     ' Respond to the supplied value of "code".
  4.     Select Case code
  5.         Case acLBInitialize                     ' Called once when form opens.
  6.             Set db = CurrentDb()
  7.             Set dox = db.Containers!Reports.Documents
  8.             iRptCount = dox.Count               ' Remember number of reports.
  9.             For i = 0 To iRptCount - 1
  10.               * If Left(dox(i).Name, 1) <> "~" Then
  11.                    * sRptName(T) = dox(i).Name       ' Load report names into array.
  12.                    * T = T + 1
  13.               * End If
  14.             Next
  15.             EnumReports = True
Dec 12 '06 #2

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

Similar topics

4
6752
by: Frank Millman | last post by:
Hi all I need to generate potentially large reports from a database, and I want to offer the option of print preview before actually printing (using wxPython). I figure that the best way to...
0
8397
by: Didier ROS | last post by:
Hi, I am a newbie I want to create a temporary table and I get the following error message : mysql> CREATE TEMPORARY TABLE tempemp AS SELECT * FROM emp; ERROR 1044: Access denied for user:...
2
1253
by: airkart | last post by:
Hello, I've scoured groups and the web, and haven't found a question like mine answered. I'm using Visual Studio 2003 with the Crystal Reports it comes bundled with and SQL Server 2000....
4
7251
by: Jerry Krinock | last post by:
I've written the following demo to help me understand a problem I'm having in a larger program. The "main" function constructs a Foo object, and then later "reconstructs" it by calling the...
6
2091
by: Justin | last post by:
Hello, first time posting. If I have a base class and a derived class, is there only one way to call the base constructor? i.e. Is this the only way I can call the base constructor...
31
5151
by: Peter E. Granger | last post by:
I'm fairly new to C++ and VC++, but for the most part it seems to do most of the same things that can be done in Java, with just some syntactic and structural adjustments. However, one thing I...
4
4937
by: Michael | last post by:
Hello, I want to use an object (LowCut) within another object (SampleRateConverter) like it is written as follows: class SampleRateConverter { public: SampleRateConverter( int...
1
1947
by: popwhub | last post by:
I am having problems printing some reports from my application that are generated from temporary tables. The application has an Access FE and a SQL Server BE. The current method uses a temporary...
7
2044
by: google | last post by:
I am trying to automate the way reports are printed in an Access 2003 database - I have ~200 records (people) who require between 5 and 10 customized reports (depending on values within certain...
0
7090
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6960
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7116
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6825
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5418
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
595
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
247
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.