I have created a form for listing my reports using tips and code from Allen Browne's website. The Code is as Follows: - Function EnumReports(fld As Control, id As Variant, row As Variant, col As Variant, code As Variant) As Variant
-
' Purpose: Supplies the name of all saved reports to a list box.
-
' Usage: Set the list box's RowSourceType property to:? EnumReports
-
' leaving its RowSource property blank.
-
' Notes: All arguments are provided to the function automatically.
-
' Author: Allen Browne allen@allenbrowne.com Feb.'97.
-
-
Dim db As Database, dox As Documents, i As Integer
-
Static sRptName(255) As String ' Array to store report names.
-
Static iRptCount As Integer ' Number of saved reports.
-
-
' Respond to the supplied value of "code".
-
Select Case code
-
Case acLBInitialize ' Called once when form opens.
-
Set db = CurrentDb()
-
Set dox = db.Containers!Reports.Documents
-
iRptCount = dox.Count ' Remember number of reports.
-
For i = 0 To iRptCount - 1
-
sRptName(i) = dox(i).Name ' Load report names into array.
-
Next
-
EnumReports = True
-
Case acLBOpen
-
EnumReports = Timer ' Return a unique identifier.
-
Case acLBGetRowCount ' Number of rows
-
EnumReports = iRptCount
-
Case acLBGetColumnCount ' 1 column
-
EnumReports = 1
-
Case acLBGetColumnWidth ' 2 inches
-
EnumReports = 2 * 1440
-
Case acLBGetValue ' The report name from the array.
-
EnumReports = sRptName(row)
-
Case acLBEnd
-
Erase sRptName ' Deallocate array.
-
iRptCount = 0
-
End Select
-
End Function
How do I keep this from listing "~TMP*" repoorts?
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: - Function EnumReports(fld As Control, id As Variant, row As Variant, col As Variant, code As Variant) As Variant
-
' Purpose: Supplies the name of all saved reports to a list box.
-
' Usage: Set the list box's RowSourceType property to:? EnumReports
-
' leaving its RowSource property blank.
-
' Notes: All arguments are provided to the function automatically.
-
' Author: Allen Browne allen@allenbrowne.com Feb.'97.
-
-
Dim db As Database, dox As Documents, i As Integer
-
Static sRptName(255) As String ' Array to store report names.
-
Static iRptCount As Integer ' Number of saved reports.
-
-
' Respond to the supplied value of "code".
-
Select Case code
-
Case acLBInitialize ' Called once when form opens.
-
Set db = CurrentDb()
-
Set dox = db.Containers!Reports.Documents
-
iRptCount = dox.Count ' Remember number of reports.
-
For i = 0 To iRptCount - 1
-
sRptName(i) = dox(i).Name ' Load report names into array.
-
Next
-
EnumReports = True
-
Case acLBOpen
-
EnumReports = Timer ' Return a unique identifier.
-
Case acLBGetRowCount ' Number of rows
-
EnumReports = iRptCount
-
Case acLBGetColumnCount ' 1 column
-
EnumReports = 1
-
Case acLBGetColumnWidth ' 2 inches
-
EnumReports = 2 * 1440
-
Case acLBGetValue ' The report name from the array.
-
EnumReports = sRptName(row)
-
Case acLBEnd
-
Erase sRptName ' Deallocate array.
-
iRptCount = 0
-
End Select
-
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... - * Dim T As Integer 'New Array Index to prevent "Holes"
-
-
' Respond to the supplied value of "code".
-
Select Case code
-
Case acLBInitialize ' Called once when form opens.
-
Set db = CurrentDb()
-
Set dox = db.Containers!Reports.Documents
-
iRptCount = dox.Count ' Remember number of reports.
-
For i = 0 To iRptCount - 1
-
* If Left(dox(i).Name, 1) <> "~" Then
-
* sRptName(T) = dox(i).Name ' Load report names into array.
-
* T = T + 1
-
* End If
-
Next
-
EnumReports = True
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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
|
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...
|
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...
|
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)
| |
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...
|
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 )
{
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |