473,387 Members | 1,532 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.

print report from selection(list box)

i have list box which displays all the reports available on my database using the query below c/o allen brown...my problem now is i cant find ways to code and preview/print or open the selected report...can somebody share me a taught of how will i do this...thanks


SELECT MsysObjects.Name
FROM MsysObjects
WHERE (((MsysObjects.Name) Not Like "~*" And (MsysObjects.Name) Not Like "MSys*") AND ((MsysObjects.Type)=-32764))
ORDER BY MsysObjects.Name;
Jun 8 '07 #1
4 2700
Fekri
8
Hi,

The best way I think is:

in After update of the list box ("list0"):

Me.RecordsetClone.FindFirst "[report code] = " & Me![List0]
Me.Bookmark = Me.RecordsetClone.Bookmark


and in Form record source you have to select the name of table which you have all the report Description.
Of course in this table you should have one field ("[report code]") to have report Number as will descriped in the list box and another field ("[report file name]") which have report name which the name you saved the report with that.

so by ceating the button you should have on click :

Stdoc = Me.Report_file_name
DoCmd.OpenReport Stdoc, acViewPreview


Good luck
Ali
Jun 8 '07 #2
hi i was able to preview the reports..ur code is perfectly working..now is it possible to add a command button that will export the selected report into excel file and file name will be report name and the current date.tnx
Jun 15 '07 #3
for the purpose of sharing,


Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
stdoc = Me.Report_file_name
DoCmd.OutputTo acOutputReport, stdoc, xls

Exit_Command11_Click:
Exit Sub

Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click

End Sub


the code will export the selected report...

is it possible that file name of exported report will be reports name plus the current date.
Jun 15 '07 #4
repost

Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
stdoc = Me.Report_file_name
DoCmd.OutputTo acOutputReport, stdoc, xls

Exit_Command11_Click:
Exit Sub

Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click

End Sub


the code will export the selected report...

is it possible that file name of exported report will be reports name plus the current date.[/quote]

for the purpose of sharing,


Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
stdoc = Me.Report_file_name
DoCmd.OutputTo acOutputReport, stdoc, xls

Exit_Command11_Click:
Exit Sub

Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click

End Sub


the code will export the selected report...

is it possible that file name of exported report will be reports name plus the current date.
Jun 18 '07 #5

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

Similar topics

5
by: Mark | last post by:
I have an application that uses PHP to access a MySQL table and extract rows which match the user's search entry. Data from the matching rows are loaded into an HTML selection list, and the user...
0
by: JJ | last post by:
I'm using the CrystalReportViewer1.PrintReport() method in a vb.net exe but DO NOT want the Windows Print Box to appear (I require the report to print directly)
5
by: Jim Cobban | last post by:
I am trying to create a web page in which the contents of one selection list depends upon which element in another selection list is chosen, but where the information to populate the first...
3
by: Kevin | last post by:
Allen, I tried creating one of the report list boxes you have on your page (http://allenbrowne.com/ser-19.html). I created the chk box, cmd button, and module (saved as EnumReports). I...
5
by: srampally | last post by:
I need the capabilty to hide/show a selection list, just the way its done at http://www.lufthansa.com (place the cursor over "Group Companies"). However, I am looking for a javascript that is much...
0
by: paulcybulski | last post by:
I have a main window with a minimap of the main window...I have created a transparent minimap selection box that shows the view of the main window...so when you zoom in on the main window...the...
4
by: sialater | last post by:
Hello, I realise there are a lot of topics related to this problem but many of what I have found has run cold or unresolved. What I have is an addressbook clone where there are groups which have...
5
n8kindt
by: n8kindt | last post by:
hi, i have a selection list that has 150 options in it. in firefox i have no problem with my current set up. when u click on the list box, the menu drops down. but in internet explorer, the menu goes...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.