473,549 Members | 4,476 Online
Bytes | Software Development & Data Engineering Community
+ 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 1717
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
6758
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 achieve this is to write the report to a temporary file, or more likely to a temporary directory with a separate file for each page. I can use that for...
0
8400
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: '@localhost' to database 'test1' Any help would be appreciated
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. Throughout the project I'm working on, I often find I need a temporary table displayed in a report, something that I cannot seem to do. Since temporary...
4
7266
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 constructor again. In my larger program, I find that the member variables don't get re-initialized when "reconstructed". I don't have that problem in...
6
2098
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 (presuming the base constructor took an int): Derived::Derived(int a) : Base(a)
31
5159
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 haven't been able to figure out is how to call one constructor from another within a class. It's easy enough to call the base class's constructor from...
4
4950
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 iSourceSampleRate, int iTargetSampleRate ) {
1
1955
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 workspace. This workspace uses ODBCDirect which bypasses the JET engine completely. However, these objects are temporary and are destroyed at the end...
7
2050
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 fields) - currently I print each report by selecting all employees and printing one report at a time - once all reports are printed, I manually...
0
7526
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7962
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7480
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7814
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6050
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5373
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
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 we have to send another system
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.