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

Drop-down reporting?

El
I have a table called Product Code Master with fields Product_Code and
Description. Currently I have individual reports set up for different
types of products and the user simply clicks a macro button for the
report type they need on Frm_Open and type in the product code they are
looking for.

Is there a way I can eliminate the user choosing which report to print
and some how have a drop down list where they could chose the product
code they need and the report for that item in the correct report
format appears? Example: User needs information for Report 1, XXXX.
If they choose XXXX from the drop-down, then Report 1 would appear.

Any suggestions would be great!

Jul 25 '06 #1
5 1411
If the format/layout for the reports is the same, why not just filter
the report in the Open event? Just specify a valid filter when you
open the report

Jul 26 '06 #2
El

pi********@hotmail.com wrote:
If the format/layout for the reports is the same, why not just filter
the report in the Open event? Just specify a valid filter when you
open the report
That's part of my problem; the format/layout is different for each
report.

Jul 26 '06 #3
Do you have a FieldName, like "ProductType" that you can use to
determine what report to use? otherwise, your code for determining
what report to open will never stop growing. If you had the reportname
and/or the category in one of the hidden columns in the dropdown, you
could just reference that.

docmd.openreport "MyReport",,,ProductType=cboChooseReport.Columns(2 )

Jul 27 '06 #4
El

pi********@hotmail.com wrote:
Do you have a FieldName, like "ProductType" that you can use to
determine what report to use? otherwise, your code for determining
what report to open will never stop growing. If you had the reportname
and/or the category in one of the hidden columns in the dropdown, you
could just reference that.

docmd.openreport "MyReport",,,ProductType=cboChooseReport.Columns(2 )
Okay, I added a FieldName called ProductType. I tried entering the
command you listed above in my dropdown and it gives me runtime error
424 and says something about no object. I put the name of my report in
the place of "MyReport". Is there something additional I need to add
to the command? I'm not very good at codes. Thanks for your help!

Jul 27 '06 #5
Did you have a look at Northwind?

Option Compare Database ' Use database order for string comparisons.
Option Explicit ' Requires variables to be declared before they are
used.
Sub PrintReports(PrintMode As Integer)
On Error GoTo Err_Preview_Click
' This procedure used in Preview_Click and Print_Click Sub
procedures.
' Preview or print report selected in the ReportToPrint option
group.
' Then close the Print Sales Reports Dialog form.

Dim strWhereCategory As String

'---SET THE FILTER FOR THE REPORT....
strWhereCategory = "CategoryName = Forms![Sales Reports
Dialog]!SelectCategory"

Select Case Me!ReportToPrint
Case 1
DoCmd.OpenReport "Employee Sales by Country", PrintMode
Case 2
DoCmd.OpenReport "Sales Totals by Amount", PrintMode
Case 3
If IsNull(Forms![Sales Reports Dialog]!SelectCategory) Then
DoCmd.OpenReport "Sales by Category", PrintMode
Else
DoCmd.OpenReport "Sales by Category", PrintMode, ,
strWhereCategory
End If
End Select
DoCmd.Close acForm, "Sales Reports Dialog"

Exit_Preview_Click:
Exit Sub

Err_Preview_Click:
Resume Exit_Preview_Click

End Sub

<straight outta the DB...

Jul 27 '06 #6

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

Similar topics

1
by: riehe | last post by:
Dear all I want to drop a node from a nodegroup. Can someone confirm if its enough to redistribute a node group with a partition map which doesn't include the node to be dropped? I can't see...
1
by: Ian Dobson | last post by:
Hi, I need to drop a schema from a database but it has 400 tables in it. Is there an easy way to do it other than drop table schema1.table1 drop table schema1.table2 etc.. to 400 and then drop...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
0
by: Lauren Quantrell | last post by:
I'm trying to drop a file from Windows Explorer (or desktop, etc.) onto a field in Access2K and capture the full file path. I found an posting below that says this is possible but I cannot...
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
3
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
1
by: Darren | last post by:
I'm trying to create a file using drag and drop. I want to be able to select a listview item drag it to the shell and create a file. Each icon in the listview represents a blob in a database. When...
15
by: uwcssa | last post by:
I try to drop a table as: I got: During SQL processing it returned: SQL0478N The object type "TABLE" cannot be dropped because there is an object "sch.SQL070515104729271", of type "FUNCTION",...
1
by: Thi | last post by:
Hi, I am trying to develop an application that allows the users to drag a few file(s) from a zip archive to a destination. My question is, how do i determine where the drop destination is...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.