Open Report Based On List Box Result?

Oct 24, 2013

I am trying to setup a button that will open a report on click. The catch is that the report name is coming from a query result that is populated into a list box. The way it works the list box will never have more than one result so by default it will always house the name of the report appropriate to a chosen client. I would like to do it this way so that I don't have to clutter up the from with extra buttons all pointing to specific reports.

I found some references to this in this forum, including the example listed below, but I have been unsucessful in making work so I assume that I am entering wrong, entering it the wrong place or maybe the code is incomplete. Unfortunately I am a complete novice to Access VBA so I am still learning how it all works together.

List box name is BillingFormat

The first of 5 reports is named Standard Billing

So in the form I enter the client number and BillingFormat is auto populated with Standard Billing

I tied the button to this code: DoCmd.OpenReport Me.BillingFormat, acPreview

The results I was looking for was for the report named Standard Billing would open. The first way I set it up nothing happened not even any errors. The other way threw an error stating it did not recognize DoCmd as a valid function.

what I am doing wrong?

View Replies


ADVERTISEMENT

Reports :: Open A Report But Only Showing The Result Of One Record In A Sub Form?

Jun 21, 2013

i want to open a report but only showing the result of one record in a sub form,

i have a field that is on all rows of the subform,[click to run] and what i want the user to be able to do is double click on this field and it will open the report with only the record information for that row displayed.

View 1 Replies View Related

Forms :: Open Report Button To Select Data From 7 List Boxes And Present In A Report?

Aug 13, 2015

I have a form with 7 List boxes linked to 7 Query's which in turn are linked to a table. Each list box if for a particular trade.

I am trying to select a person or persons from each List box and then have them sent to a report. I have Code to do one list box, but do not know how to link all boxes with code to a 'Open report' button.

The code I am using is as follows:-

Private Sub cmdOpenReport_Click()
On Error GoTo Err_cmdOpenReport_Click
Dim strWhere As String
Dim ctl As Control
Dim varItem As Variant
'make sure a selection has been made

[code]....

View 9 Replies View Related

Open Report From Multi-select List Box

Jul 22, 2015

I am running MS Access 2010 on Windows XP and my access skills are limited.

So I have a db with tables, forms and reports and would like to give my users the option of opening a filtered report (from a form).

The form (frmSelectStatus) and report (rptStatus) have been created and both open correctly by normal selection from the 'All Access Objects' side bar.

frmSelectStatus has a multi-select list box (lstStatus) and a command button (cmdStatus). When I click cmdStatus i get the correct report opening but it is all status records and not filtered by the selection made in lstStatus - and i know this is a result of not referencing 'lstStatus' in the code. i also have a query (qryStatus) which does not contain anything.

My 'on-click' code for cmdStatus is

Private Sub cmdSelect_Click()
DoCmd.OpenQuery "qryStatus", acViewNormal, acEdit
DoCmd.OpenReport "rptStatus", acViewReport
DoCmd.Close acQuery, "qryStatus"
End Sub

I know I need to reference 'lstStatus' but am not sure where or how to do that in the code.

View 1 Replies View Related

Report To Open Based On Comobox Selection

May 9, 2013

I have some code that was written by someone else. I am trying to duplicate this in another database but, can't seem to get it to work. I also don't understand how this code is working as as there is no reference to the combo box in the code behind the print button. But depending on what you select in the combo box the report opens and filters on that selection. The following code is behind the print button. There is a separate combo box, that does not seem to have a connection to the print button. It just has a query behind it for the items to select from.

Public Sub BTNPrint_Project__Job__Numbers_Click()
On Error GoTo Err_BTNPrint_Project__Job__Numbers_Click
Dim stDocName As String
stDocName = "RPTProject Number (Job) Book Year"
DoCmd.OpenReport stDocName, acPreview
Exit_BTNPrint_Project__Job__Numbers_Clic:
Exit Sub
Err_BTNPrint_Project__Job__Numbers_Click:
MsgBox Err.Description
Resume Exit_BTNPrint_Project__Job__Numbers_Clic

View 14 Replies View Related

Run A Query/report Based On Selection From List

Feb 10, 2006

Dear all, is it possible to run a query (or ideally a report) based on a selection from a drop down list in a form? (in accsess 97). The reson being is i have a big list of of codes for different absence reasons & at present the user has to type in the correct code to display the data in a report based on the code they enter, however its not easy for users to remember which code to type in to run a report.

Idealy what i would like is a drop down list with the absence codes & the absence desciption next to each code, then when the user selects a code from the list it displays the corresponding data in the report?

Is this possible?, any help would be much appreciated, thanks.

View 4 Replies View Related

Forms :: Open Report Based On Combo Box Selection?

Jan 29, 2014

I am struggling to pull out a report based on the combo box selection. I have NOI database and want to pull out a report for a specific customer that how many NOIs are generated by this customer..

I have a separate table of customer and another table of NCRs and the customer information comes from customer table.

I have tried the below statement but gives me an error message:

code for Macro that pulls the report in click event:

[CustomerName]=[forms]![CustName]![combocust1]

do i need to mention the report as well in some where in report ?

View 14 Replies View Related

Modules & VBA :: Open Report With Subreport Based On Unbound Form

Apr 14, 2015

I am trying to open a report (rptGMX-IRG) that includes a sub-report (srptRG) based on criteria that is set with two unbound fields on a form (frmGMXbook). This form has two dropdown boxes (cboGMX_No & cboMachSize) and a command button. The first dropdown box includes data located in the main form and the second dropdown includes data that is part of the sub-report.

I can get the report to open properly when I enter data into both fields on frmGMXbook.

However, the problem I am having is the inability to have one or both fields be "Like '*'" and show all associated records.

Here is the code I have on the command button.

Private Sub GMX_Preview_Click()
Dim strCriteria As String
If IsNull(Me.cboGMX_No) Then
strCriteria = "[cboGMX_No] Like '*'"
Else
strCriteria = "[GMX_No] ='" & Me.cboGMX_No.Value & "'"

[Code] ....

View 1 Replies View Related

Query Based Report Not Showing One Table In Add Field List

Jul 13, 2015

I'm an Access novice. I have a query based report that is based on several tables. All tables are joined by the same field "customer ID," but 1 table is not available under "Add Existing Fields." I cannot figure out why that table isn't available, but I need to add a field.

View 8 Replies View Related

Forms :: Open Query Based Report On Form With Matching Record

Nov 25, 2013

This is my data:

Table: "Facility Info"
Data in the table: "facility", "city", "date", etc.
Query: "Q Facility"
Report: "R Facility"
Form: "Main Form" is where the data is entered that goes into the "Facility Info" table.

In the "Main Form" there is a dropdown box where I can select the "facility".I would like to add a button to this form that opens my report "R Facility". But this report is a collection of all the facilities and I would like it to just report the ones for the facility that I selected from the dropdown box on my "Main Form".

View 9 Replies View Related

List Box Of Reports - Filtering Result

Feb 22, 2007

http://allenbrowne.com/ser-19.html

I use the call back function to generate my list of reports in a list box.

I chose to use this method as it seems like an easy way to do what I want, and to a certain extent understand how it works.

What I would really like to be able to do, is have it filter the list of reports.

For example, some reports are for me working behind the scenes, and also so many are subreports that go in to the main report so dont need listing.

I would like to have a report names 'Clients Full Report', 'Clients Medication Report' etc on the list (I dont mind changing report names as I think that will be the key to making it work) So many of my sub reports have client in its name, so if a report could be named '1Clients Main Report' and the code looks for the number 1 and removes the 1 from the list so it displays Clients Main Report on the list.

So its just a way to make the list box only include specific reports based on a number.

Any suggestions?

View 6 Replies View Related

Queries :: List Field Result In One Row

May 3, 2013

How can list the contents of one field columns in one row in a report.

Example:
ID: 1
A1
A2
A3
A4

Should be: ID1 - A1, A2, A2, A3, A4

View 3 Replies View Related

Enter Result According To Drop Down List

Oct 11, 2011

I'm trying to write a DB to record lab results within a specification limit, and run a report to print the results on a certificate based on an automatically generated batch sample number.

In tables I've managed to get a drop-down list for the 'product type', and another for a list of the tests associated (multiples allowed) with that particular type fluid type. What I'd then like to do is add result/values for each of the tick boxes selected. Currently I just get a list of the tick boxes selected.

Currently I have:

Name (select from other table)
Fluid Type (select fluid 1 to 5 from another table)
Test (test 1, test 2, test 3, test 4... ...test 8) this is where I can select multiples from tick boxes

I'd then like to type a result for (e.g.) test 1, test 4, test 6 or whatever tick box was selected. Is this possible??

I realise a workaround would be to list all the possible tests as columns and just fill in the relevant column.

Better still would be to select a fluid type, and this opens another form with minimum and maximum allowed values, where I could enter the data - can I do this and keep unique IDs for each sample?

This is with access 2010....

View 3 Replies View Related

Queries :: Search Box Result - Add Up List Of Dates That Match A Criteria

Jun 13, 2013

I am trying to add up a list of dates that match a criteria... a search box result.

I have tried DCount, and now I'm doing it through SQL, and no matter what combinations I try I still get an error - usually 3075 - Syntax error (missing operator)

But I can't find anything missing - I copy the SQL into a query view and it works perfectly... but it won't work on its own. And I've tried using DCount with the query as a query object, and I get the same error.

Code:
Dim ResultCount As Long
Dim DateSearch As Date
Dim MyDate As String
Dim MyDateAdd As Date
Dim varReturnValue As Variant

[Code] .....

I've used the >= And < option as it solves an issue with Date Time. What operator is missing!?

View 5 Replies View Related

Forms :: Get A Certain Column Of Query Result Pasted To A Text Box When Open Form?

May 7, 2014

How do I get a certain column of a query result pasted to a text box when I open the form?

View 2 Replies View Related

Forms Based On Queries With No Result

Dec 15, 2005

If you have a form that is based on a select query that has selected no records, the form will display as totally blank.

One way to avoid this is to ensure that the query is always able to select at lest one record; but Is there a way a message can be displayed if no records are selected?

View 3 Replies View Related

Return Result Based On Percentage

Aug 8, 2012

I have a table that has 3 columns: Unique number, Date, and Results

I want the user to enter the unique number and date into the form. Then the "results" column/field will autopopulate a 0 or 1. I want it to populate a 0 85% of the time and a 1 15% of the time. This should be cumulative (meaning not every entry has a 15% chance of being 1). Is this possible?

View 1 Replies View Related

Forms :: Control Setup - Bind List Box Result To Table Field

Nov 5, 2013

I want a List Box on a Form that takes its available drop-down values from tblDiscipline and puts the value selected into the Discipline Field of tblEquipment.

The problem is I set the Control Source of the List Box to tblDiscipline (so the List Box can use these values for the drop-down selections) and when I make a selection it tries to put it back into tblDiscipline instead of tblEquipment, because I can't find anywhere to set the table that the result should be Bound to.

How can I set up a control, such as a List Box, so that it gets its values from one table but returns them to another?

View 1 Replies View Related

Reports :: Can Create A Date Parameter Box Open Up / When Open Report

Sep 21, 2014

I have a report based on a query that has data for many dates. At the moment I have put a specific date in the criteria of the query so that I could build the report format. So it now displays all the data for the date i have in the criteria section. I will need to run this report several times per week so the specified date (and corresponding data in the report) will need to be changed to a new date when I open the report i.e. when I open my report I want to show data in the report only for a specified date.

Can I create a date parameter box open up when I open the report? Can I create a form with a button that when I click will open the report displaying data for that date? What would be the best way?I also need to display the specified date on the report.

View 5 Replies View Related

Search Result Based On The First Letter Of A Field

Sep 29, 2006

Hello,

I need to create a query that will seach through a column and only return a result with product codes starting with A.

An example of a product code is AA0000034567.... however there is no realy consistancy. Some start with the AA and some don't. Some have 5 zeros before the numbers start others may only have 1, 2, 3, or 4 zeros before the number.... There are approx 76,000 product codes in total.

My end goal is to create a query to find all the records that have a product code starting with A so that I can eventually delete the AA00000 portion of the code and strip the number back to the point where the 34567 starts.

I figured that by separating out the product codes that start with AA would be a good start.

If any one has any suggestions please let me know.

Peter Vav

View 4 Replies View Related

Update Query Based On Another Queries Result

May 14, 2007

I currently have the sql below...
UPDATE tbl_Node_List INNER JOIN qryUpdate_P1 ON tbl_Node_List.Zip = qryUpdate_P1.[Zip Code] SET tbl_Node_List.[Date Sent] = (SELECT [MinOfAudit Date] FROM qryUpdate_P1), tbl_Node_List.[Date Recv'd] = (SELECT [MaxOfAudit Date] FROM qryUpdate_P1)
WHERE (((tbl_Node_List.Zip)="35243"));

but I get an err.msg stating the operation must use an updateable query.

What I am trying to do is update my dates in 'tableA' with the max and min values stored in 'tableB'. I have read some of the posts but still can't quite get it. As always all help is appreciated.

View 2 Replies View Related

Validate A Number Based On A Query Result

Mar 20, 2006

Hello

I have a field called [Hours]
If a user tries to change the [Hours] I need to check if any of these hours have been assigned to staff in another table.

How do I get to run the query and use the value from the result of the query as the Minimum value?

I would like to
run sql and if the value is being entered into the [HOURS] field is less then show a message and do not change allow the value to change.

I am sure this can be done in VB but I am am unsure of the syntax

I hope U can help

View 1 Replies View Related

Result Of Subquery Based On Snapshot Query Is Not Readonly

Apr 24, 2008

I have a database with sensitive data. I dont want users to change the data, so i used a snapshot query. However when i use this query in another query, the result is an updateable query.

Is there a way around this?

View 2 Replies View Related

Use Multi-select List Box To Filter A Report With Two List Boxes

Nov 20, 2013

Allen Browne's "Use a multi-select list box to filter a report" solution, in particularly with two multi-select list boxes? The code works fine for me for either box so long as I code it for one box alone. Combining the two into one code results in a type mismatch error. I'm trying to use the code to pass the contents of both multi-select boxes as Where conditions to a report. Both boxes are based on number fields. To try to isolate the problem, I've removed Allen's setDescription and OpenArgs conditions. We're unfortunately still on Access 2003 as the company desires to squeeze every dime by using until end-of-life next year.

Code:
Private Sub cmdPreview_Click()
On Error GoTo Err_Handler
'Purpose: Open the report filtered to the items selected in the list box.
Dim varItem As Variant 'Selected items

[Code] .....

View 14 Replies View Related

Eliminating Duplicate Rows In A Query Result Based On One Column

Apr 22, 2014

I have a query based on 2 tables, joined on Memberid, the result showing :

Table1 Table1 Table1 Table2 Table 2 Table2
Category Association Memberid CustomerName E-mailAddress MemberID

Board Member(Lookup,integer) SAMGA(Lookup,integer) 44 Smith smith@abc.co.za 44
Board Member ADHTY 44 Smith smith@abc.co.za 44
Grower SAMGA 44 Smith smith@abc.co.za 44

I only want to show 1 row, based on the duplication of E-mail address. I know i should be using the row_number function, but cannot get to the result I want.

View 4 Replies View Related

Only Showing The Avg Result For Fields-report

Jun 12, 2006

Please help

I have created a database to track student grades. I have made a report that shows the different grades for each criteria of each unit but, because the students get to do the unit many times it shows the same criteria many times on the report. What I want to do is have the report show only the best grade for each criteria.

i also want to be able to work out the average grade for each unit from the best grade for each criteria and store this for use in another table.

If you require more info i would be happy to supply this. Thanks

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved