Modules & VBA :: Remove Prompt While Running Report
Apr 9, 2015
I posted this within the Reports as well, but since this has a little bit of VBA decided to ask this here as well.
I have a report that is created from the following query (qryTotalProjectHours). What I am trying to do is get the total hours spent on Tasks within a given time period. A given Task can we worked on by multiple individuals and hence I need to find a way to aggregate the hours spent.
Code:
SELECT TasksEntries.Project, TasksEntries.Task, Sum(TimeTracker.WorkHours) AS TotalHours
FROM TasksEntries INNER JOIN TimeTracker
ON (TasksEntries.EmployeeId = TimeTracker.EmployeeId) AND (TasksEntries.TaskID = TimeTracker.TaskId)
GROUP BY TasksEntries.Project, TasksEntries.Task
I accept the start and end dates in a form and pass it like shown below. WorkDate is a column in the TimeTracker table and is not present in any other table.
Code:
strWhere = "WorkDate BETWEEN #" & txtMgrRptStartDate & "# AND #" & txtMgrRptEndDate & "#"
DoCmd.OpenReport "rptTotalProjectHours", acViewPreview, "qryTotalProjectHours", strWhere, acWindowNormal
When the report is invoked, I get a box where it says
"Enter parameter value" for Workdate..
Is there anyway I can get rid of the prompt? I never thought you needed the column name in the SELECT statement to be able to run this.
I should add the I tried the query with the WorkDate hardcoded in there and it worked fine and returned the correct results
I have attached the cut down version of the database that I am working on.Open up the frmManagerReport Form
Leave the Employee drop down empty
Enter the start and end dates ( I have used 4/1/2015 and 4/30/2015)
Select the 3rd option "Generate Tasks by Total Hours"
click on Run
When you do that you will see the prompt come up. Enter any date and you will see the report. The report generated uses the results from the query and does not filter on the date selected in the form. This is what I have been struggling to fix since yesterday but have reached nowhere..
View Replies
ADVERTISEMENT
Apr 8, 2015
I have a report that is created from the following query (qryTotalProjectHours). What I am trying to do is get the total hours spent on Tasks within a given time period.
Code:
SELECT TasksEntries.Project, TasksEntries.Task, Sum(TimeTracker.WorkHours) AS TotalHours
FROM TasksEntries INNER JOIN TimeTracker
ON (TasksEntries.EmployeeId = TimeTracker.EmployeeId) AND (TasksEntries.TaskID = TimeTracker.TaskId)
GROUP BY TasksEntries.Project, TasksEntries.Task;
I accept the start and end dates in a form and pass it like shown below. WorkDate is a column in the TimeTracker table and is not present in any other table.
Code:
strWhere = "WorkDate BETWEEN #" & txtMgrRptStartDate & "# AND #" & txtMgrRptEndDate & "#"
DoCmd.OpenReport "rptTotalProjectHours", acViewPreview, "qryTotalProjectHours", strWhere, acWindowNormal
When the report is invoked, I get a box where it says
"Enter parameter value" for Workdate..
Is there anyway I can get rid of the prompt? I never thought you needed the column name in the SELECT statement to be able to run this.I should add the I tried the query with the WorkDate hardcoded in there and it worked fine and returned the correct results
View 5 Replies
View Related
Apr 25, 2008
Hi,
I know this can be done but I'm a novice at VBA. I have a batch file AutoLoop.bat which I run from command prompt at the moment. The idea is to run a VBA routine behind the onClick event of a command button in Access which would run this batch file in command prompt automatically. Say if the batch file path is I:AUTOGENLOOPGENAutoLoop.bat,
what VBA code can be used.
Thanks for any help.
View 1 Replies
View Related
Nov 4, 2013
I have a simple spreadsheet:
Ref# Rev
97 b
98 c
99 c
99 e
100 c
100 b
101 a
102 b
I need to create a simple report but remove the duplicates (ex. Ref# 99,100). I need to delete the older Rev's (Ex Ref# 99 Rev C, Ref# 100 Rev B).Is this done throughRecordsets? will an SQL query do the trick?
View 7 Replies
View Related
Sep 15, 2013
I have a count and store data INTO a table named USTATE
When I run the query it works within 30 seconds. but when i add INTO USTATE then it takes 4-8 minutes to complete it and asks for if i want to delete the existing.
View 1 Replies
View Related
Jan 4, 2013
I have a couple of questions which are sort of related. They both revolve around Parameters with a Query/Report.
Here is a bit of background. The source Table is formatted in a way similar to this:
Code--Account#--Expense Description--Jan--Feb...
When running the Query, and associated Report, the user is prompted to input an Account# via a Parameter that I set up. The dialog box pops up with the word "Account#" and a box for the user to enter by what account that they want to restrict the Report. [Question 1] - Is there a way to make this dialog box contain a drop-down box with a list of predetermined accounts instead of the aforementioned entering of an account number? If not via this dialog box, is there another way?
Also, multiple accounts roll up into a single P&L line item. For example, let's say that accounts 1234 and 5678 both make up "Equipment". [Question 2] - Is there a way to run the Report in such a way to return all accounts which roll into a line item? I want to have the ability to run by either an individual account or the P&L line in total.
View 14 Replies
View Related
Feb 22, 2015
This code puts pdf reports into a folder . I am prompted for a number via the query I run because I have more than one report the query asks me 3 times. Could this be modified so I only get prompted once for all the reports in the code
On Error GoTo Err_Handler
Const FOLDER_EXISTS = 75
Const MESSAGE_TEXT1 = "No current invoice."
Const MESSAGE_TEXT2 = "No folder set for storing PDF files."
Dim strFullPath As String
[Code] .....
View 6 Replies
View Related
Jul 18, 2013
On a report I have an image. Its properties are:
Name: OLEUnbound9
OLE Type: Embedded
OLE Type Allowed: Either
OLE Class: Microsoft Photo Editor 3.0 Photo
Class: MSPhotoEd.3
When I try and delete it I get an error message: The OLE server isn't registered. To register the OLE server, reinstall it
How do I reinstall it, or better still how do I simply delete the image?
View 1 Replies
View Related
Sep 6, 2004
I've been reading up quite intensively on using QueryDef's collection to try to pass a Parameter to a Query in order to then Open a Report. But can't seem to get it to work. I've been trying to write an SQL statement that the VB will accept in code but never got it to work. Depite copy/pasting the SQL from the Query Access creates. regardless.. I really need some help with this one. Thanks. Procedure follows. Get error that Report not found... The name is correct... I just want to pass the integer (index) from the ListBox into the Query then Open the Report... Thats all...
Private Sub previewReport_Click()
On Error GoTo Err_previewReport_Click
Dim intSelectMonth As Integer 'The Index of the Item Selected in Form List Box
Dim db As Database
Dim smReport As Report
Dim smQuery As QueryDef
Dim month As Parameter
Set db = CurrentDb
Set smQuery = QueryDef![GetReviewsMonthQuery]
smQuery.Parameters![rvMonth] = 9 'Using 9 as September just for Testing
Set smReport = Reports![Review Schedule by Month/Analyst]
DoCmd.OpenReport smReport, acPreview
Exit_previewReport_Click:
Exit Sub
Err_previewReport_Click:
MsgBox Err.Description
Resume Exit_previewReport_Click
End Sub
View 2 Replies
View Related
Jun 23, 2005
Dear All:
I have created a database to keep track of transcripts that are requested. This database has their names, ID number, date requested(With a pop-up calender), transcript type requested(This is a combobox where the choices are "Official Copy" and "Student Copy") and address.
So far, it works great. What I wish to do is run a report that I can choose the begining date and ending date for a specified month to see the total "Official Copies" and "Student Copies" for a given month.
Any ideas out there?
Hats off to Colm!
Regards,
Dion
View 4 Replies
View Related
Dec 7, 2005
How do I get a query to run upon opening a report. My report has a few fields from a query that once the user inputs information the query is obviously outdated. Since it needs to be as simplistic and user friendly as possible I won't ever have them run the queries themselves so I'm trying to have them run to be updated for the report when the user goes to open the report.
View 1 Replies
View Related
May 2, 2013
I have created a custom menu used on my reports which contains all the icons I need and anchored them to the right side of the report. I have been able to remove the min, max and the close icons from the default report menu bar at the top right hand side as well as the "Ask A Question" dropdown. But I am not able to remove the "Restore window" button that comes with the report print preview.
How do I remove the "Restore Window" icon from the report's menu bar?
I'm using Access 2003...
View 3 Replies
View Related
Mar 14, 2012
How to remove unwrap text after exporting report from Access to Excel?
View 11 Replies
View Related
Dec 7, 2005
I built a database off of the access wizard and it gives me the capability to enter date parameters before running my reports, than displaying the revised report. I.E. I am prompted to enter start and finish dates, and then after entering this info and hitting a button to preview the report, the only data displayed is that that falls into that date range.
I have created a new report that wasn't built into the wizard. This report "hits" an underlying query. I have also added a button on the switch manager to preview the report. I want a user to be able to click that preview report item on the switch manager, then be prompted to enter start and finish date information, then hit an ok button, then have the report with the relevant information displayed.
Any and all help would be greatly appreciated. Thanks.
View 5 Replies
View Related
Mar 28, 2014
My database is slowly coming together. For the final part of this phase i would like to create a shortcut on each users desktop which runs a summary report of information within my database.
I have criteria set so upon opening the report the user is asked for which address they wish to see information from which works great. But I do not want users to have access to the database, I just want them to be able to click a shortcut, be asked what address they are looking for and for the report to ping up in a 'Print Preview' type layout so information can be seen and displayed but not altered. All users have the access program.
View 2 Replies
View Related
Aug 6, 2013
How does one go about removing a recordset from a ListBox?
I have a list box that I want to toggle between using a query and an ADO RecordSet to populate the values.
Once I set the listbox .RecordSet property to the ADO.Recordset, I can't remove the values displayed in the listbox when I assign a query to the .RowSource property.
I suppose I can turn the .RowSource query to an ADO Query but I am being lazy and don't want to rewrite the query as a T-SQL query.
I previously thought the list box was pulling data from the .RowSource query but I realize I was wrong.
View 1 Replies
View Related
Jul 22, 2013
I have changed numerous features in "Current Database" under "Options", but I am unable to achieve what I need. I just need a popped form to show up when the program is initiated (no other background), meaning, I want to hide all the Runtime menu. I am able to get to the point of just the form showing up, but the form is maximized, which is not what I desire.
View 2 Replies
View Related
Feb 23, 2015
I have a multiple record form that displays fine. However, on the left hand side there is a column that when a record is selected, an arrow appears there. I don't know what this is called in order to suppress it.
View 4 Replies
View Related
Feb 25, 2015
I have a Memo field that is used to be a description of a document. I don't know what the user will put in (could be anything), but it is eventually passed in a string to a query, etc.I discovered during testing that if an apostrophe is entered (Ex: This document explains how to deal with Joe's pleasant disposition.), it breaks my code. I then realized that all reserved words and characters would cause this problem.
I can get around this one just by using Replace(str, "'", "''"). However, I know there are others that will cause problems, and I don't want to end up with a string of replace statements just to fix them.
View 2 Replies
View Related
Jun 16, 2014
I have a database and one of the functions is to track the purchase of fuel. Part of purchasing fuel is registering what the current odometer reads. My query gets the Vehicle ID, Date of Transaction and Odometer reading. I want to show a report that shows how many miles the vehicle is has traveled for a certain amount of time. If it's for 2013 then I'll put the criteria for 2014 in the date. This will give me a list of all vehicles and their odometer readings. I then sort the date by ascending.
In the report I group on vehicle ID and then I want to show all their transactions and add up how many miles were driven.
Vehicle 1
1/2/201
1/5/2013
1/15/2013
ETC...
Total Miles Driven in 2014: XXXXXX
View 1 Replies
View Related
Apr 14, 2014
I have DB in access 2007. I have a report that is uses a select query to generate the information for the report. It has been working great, But however lately like maybe with in the last month, it has been causeing Access 2007 to crash. I am having the same issue with another DB that uses the same information but that information is imported in. both Databases have worked great up until two months ago. Microsoft states that it is because of the program. I have tried to repair the DB by using the Repair option. I am confused as to why this would be happening. I can create a new report and it seems to work. but I do not want to change all the DB on everyone's computer just for this reason. I also have two buttons on my report that utilize macros to close or print the report.
View 6 Replies
View Related
Aug 18, 2015
I have a query that uses the input from a form as criteria, which is then used in a report. The form input is a drop down based on another table. This is a sales pipeline report, and the list is a list of sales people. The report works perfect for all sales people except one. When I run it for the one, I get the following error:
"This expression is is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables".
I DO NOT get the same error when running the query by itself - so assuming there is something in the report causing this. I do have some sum formulas in the report.
Again, no other salespersons selected cause this error -- so I am assuming there is something in the dataset for this person that is causing the error.
View 8 Replies
View Related
Aug 6, 2013
I'm trying to setup a listbox so that multiple items may be selected and removed at once. The Listbox Multi Select property is currently set to "Extended" and I have the following code on the onclick event of a command button:
Code:
Private Sub Command12_Click()
Dim i As Integer
For i = List10.ListCount - 1 To 0 Step -1
[Code]....
I have tested selecting 4 or so records on the list box and then pushing the remove button but it seems that the only record that is removed is the selected record that is furthest down on the listbox. The other selected records become unselected and must be reselected in order to continue removing records.
View 1 Replies
View Related
Jun 12, 2014
I have a table which has duplicate records so I want to write down the code so that when the user click on a button then it should remove the duplicate records from the table.
View 2 Replies
View Related
Jun 9, 2015
I'm trying to improve the dialer that i place on microsoft access forms. basically there's a command button that dials the number that is in a text box, but we have a new job that's just come in that requires numbers to be copied and pasted into the text box. these numbers have a space between the dialing code and the telephone number and i need to make the dialer check for a space and remove it before dialing.
Here's the code for the dialing buttons:-
Private Sub cmd_Dial_Click()
On Error GoTo Err_cmd_dial_Click
CT.MakeCall "8" & txt_telephone.Value & "#", "", False, "", "", False
[code]...
View 5 Replies
View Related
Jun 5, 2014
I would like to put a message on the screen for informing the user - mostly during some procedures that might take time or when, after a warning, I want to go on with the program but without action from the user.
Msgbox is obviously not the one I'm looking for as it needs customer acknowledge. Is there a solution for this task?
View 1 Replies
View Related