473,714 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!R eports.Document s
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 acLBGetColumnCo unt ' 1 column
EnumReports = 1
Case acLBGetColumnWi dth ' 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 2141
Try the rowsource of the listbox

SELECT msysobjects.Nam e FROM msysobjects WHERE (((Left([Name],3))<>"Sub")
AND ((msysobjects.T ype)=-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!R eports.Document s
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 acLBGetColumnCo unt ' 1 column
EnumReports = 1
Case acLBGetColumnWi dth ' 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
1306
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 column 1 untill intIndex changes to 2. Then column 2 has to be filled and so on.. --
5
14539
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 automaticlly. Is there a way to do the same thing on a bound textbox so that it is automaticly updated?
4
4711
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
5451
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 it--then hold the next value through the next set of nulls, and so on. See example below: I wanna copy down batch "IMR138" in record ID 1, all the way to ID 10. Then copy down batch "7138" all the way to ID 20 and so on....
2
2432
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
1846
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 Login IN (@People) AND CheckInTime @CheckIn AND CheckOutTime < @CheckOut). On the form, I have a listbox that should allow the user to select several names and those names should be passed to the @People parameter. I can't find a way to get that...
2
8466
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 calendar and it would fill the text box with the appropriate date. Database is created with Access 97.
1
2199
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 field. What I want is to fill a different table with the MachineRate as soon as I select the MachineName. Iím already storing the MachineName with the Combo Box to table1 but need to extract automatically the MachineRate into a table1 as I select...
0
1219
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 can (and will) change so it is not for me very usefull to use strongly typed DataSet-s - I will have to change definitions of them and thus program too much. I have form which contains ReportViewer. This form has DataLoad method, which fill...
0
8815
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 usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9081
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9034
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6639
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4468
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3164
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
2
2529
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2113
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.