473,387 Members | 1,678 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,387 software developers and data experts.

Fill Reports

Hello to all,

I am trying to fill all my reports in a listbox but I may not need
to show other reports. How do you modify this function to do that. I have
losts of reports but don't want to show all of them. I need to exculed certain
reports from the list box.

Public 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.
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

thanks for any help
Nov 13 '05 #1
1 2122
Try the rowsource of the listbox

SELECT msysobjects.Name FROM msysobjects WHERE (((Left([Name],3))<>"Sub")
AND ((msysobjects.Type)=-32764) AND ((Left([Name],7))<>"OTWTemp"));

1 column, bound column = 1

This does not show reports belining with "Sub" or "OTWTemp" to omit sub
reports and some special reports.
AK2, but I think it will work with earlier versions of Access.
HTH
Phil
"KEVIN97810" <ke********@aol.com> wrote in message
news:20***************************@mb-m12.aol.com...
Hello to all,

I am trying to fill all my reports in a listbox but I may not
need
to show other reports. How do you modify this function to do that. I
have
losts of reports but don't want to show all of them. I need to exculed
certain
reports from the list box.

Public 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.
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

thanks for any help

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Maurice Mertens | last post by:
Hi, How can I make a report in CR with 3 columns which will be filled one by one? I have a field, let's say intIndex, which has values 1,2 and 3. The report first have to fill the data in...
5
by: John Sheppard | last post by:
Hi there Does anyone know how to fill a bound textbox automaticlly. In an unbound textbox I would put in the control source =Sum(price, tax) (or some such function) and access updates it...
4
by: Sherwood Botsford | last post by:
Table Markers ID (Primary Key) This&That PointClass (Combo box) Points Table PointClasses PointClass (primary key) Points (number) Description (Text)
6
by: Cliff72 | last post by:
I need to fill in the nulls in the batch field the value from the record immediately preceding the null one ie replace the nulls with the preceding value until I hit a record with a value in...
2
by: Mirco Attocchi | last post by:
Hi all, someone know how to fill with gradient a box or a field or entire column in detail section? Thanks Mirco Attocchi
3
by: Shawn | last post by:
I have a set of reports that use the graphically created dataset. In the SelectCommand, I need to use "IN" in the where (SELECT FullName, CheckInTime, CheckOutTime, Minutes FROM dbo.CheckIn Where...
2
by: bruce24444 | last post by:
I have designed a database for work, which creates reports from specific start and end dates. What I'd like to add to this form is a calendar dropdown where you would click a specific date on a...
1
by: pctec | last post by:
Hello, I have a combo box that is looking into a field from a table named Machines, this machine table has two columns; MachineName and MachineRate but the Combo Box it only showing the MachineName...
0
by: LukasMalik | last post by:
Hi all, Please, would anyone advice.. My database has more than 50 tables and more than 300 views. I have to also create about 30 reports. I want to fill these reports with data from views, which...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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
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
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...

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.