Modules & VBA :: KeyDown Event For Report In Access 2003
Jun 5, 2014
I am aware that access 2007 has keyDown event for reports but access 2003 does not. My client's system is written in 2003 and he is not willing to invest in 2007.
Is there a way to have the report print by selecting F6 after the customer views the reports contents to see if they are correct.
I am using the VB KeyDown event on a text box. I am wanting to use keys F1 - F8.
The intended code runs for each key (using a case statement), but also the windows default task runs for that key i.e F1 will load help and run the code in the key press event.
Any ideas how to stop default keys for just the text box in question?
I wonder if anyone can help on this, I have a database , primarily for my own use which I have put on a common drive as some else now needs to use it. From My PC I can access all of the data etc on this copied database, but on the other PC I can't get at the reports. They are showing as there but I cant even get them in design mode, let alone run them I can access all the data in tables , design and run the queries but the reports are a complete no go. Has anyone any ideas what is wrong because I am absolutely stumped.
Hi, I have a problem which should have a relatively simple solution, I just cannot find it.
Please accept my apologies if this is in the incorrect forum, I wasn't sure whether to place it in the 'Reports' forum but I figured that my question was to do with the results of a query so I put it in here.
I have a select query which gives me the following results:
Company_Name Staff_FirstName Staff_Surname Staff_DOB ABC Ltd Joanne Robinson 08/12/1950 DEF Ltd Kevin Smith 25/04/1963 ABC Ltd Paul Jones 08/06/1947 DEF Ltd Lisa White 12/09/1965 .... .... .... .... etc etc etc etc
Apologies for the layout of the above query, it doesn't look like this when I am editing my post :-)
The field 'Company_Name' comes from the table 'tblCompany' and the fields 'Staff_FirstName', Staff_Surname' and Staff_DOB' come from the table 'tblStaff'.
I want to get a report for each company showing the company name and then underneath the details for each staff member for that particular company.
In the report footer I want to show number of companies and number of staff members overall.
How am I able to do this? I am using the count function on the report to count staff numbers, but I cannot get it to count the unique company name because of the data redundancy. Please remember that the 'CompanyID' field is hidden on the query, but this has no bearing on the data duplication.
I have thought about creating a query based on the above query and just select the 'CompanyID' and 'Company_Name' fields and then use the SELECT DISTINCT function and use the 'Count' feature on my report. This, however, would involve me having to have multiple Record Sources for my main report. I have also thought about creating a subreport on my main report and putting the RecordSource for the subreport as the new query and then somehow linking the two reports.
Thanks for any help it is much appreciated. Gareth.
I have a report, on a control tab, on a main form.
On the form are two buttons: one to show all items, and one to filter them based on a boolean field called showitem.
The buttons work with the code below.
What I want to do but cannot seem to figure out is to have the report default to no filter.
The bound query has no criteria.
I'm trying to set the filter property via the on open or on load event and even if I isolate the report, cannot seem to reach it.
Code: Private Sub b_hide_items_Click() Me.Profile_Timeline_wNotes_subreport.Report.Filter = "timeline.showItem <> 1" Me.Profile_Timeline_wNotes_subreport.Report.FilterOn = True Me.Profile_Timeline_wNotes_subreport.Requery End Sub
Private Sub b_show_all_Click() Me.Profile_Timeline_wNotes_subreport.Report.Filter = "timeline.showItem = 0" Me.Profile_Timeline_wNotes_subreport.Report.FilterOn = False Me.Profile_Timeline_wNotes_subreport.Requery End Sub
I must use XP/Access 2003 to solve this problem for reasons I won't get into.
I have a report with a Group by on City.
The users need to be able to sort by Coordinator within that OR by Client Name based on a selection they make on the form that opens the report.
-- I have tried to set .OrderBy
-- I have tried to set .RecordSource to different queries with order by hardcoded in them (I only have 2 sort options fortunately)
Is there a way to dynamically change the "Sorting and Grouping" defined in the report? This seems to be the only sorting that the report is responding to.
My Access 2003 Database contains the following objects:
1. tblTrackerData - this contains over 1,000 student enrollment records. One of the fields "QualCourseName" (text) contains the name of the Training Course that the student has enrolled in.
2. qryCourseNamesGrouped is a query based upon the above table with one field only - QualCourseName. This includes the names of the training courses and has been grouped so that only 17 training courses appear, not over 1,000.
3. frmParameter is a form that includes a combo box cboFiltered based on the above query AND a command button CmdFiltered to open a report rptCourseNamesGrouped and filter the report based on the selection made from the combo box.
I have added the following code to the OnClick event attached to the cmd button" ================================================== ======
Private Sub cboFiltered_Click() On Error GoTo Err_cboFiltered_Click Dim stDocName As String
[Code].....
When I click on the cmd button, the entire report is opened, instead of the selection that I made in the dropdown list.
I've got a simple dataset that will ALWAYS have 4 rows, against which I have assigned the colours Green, Amber, Red, Grey. So I made a simple pie-chart to go on the report, but I can't work out how to assign the same colours.
Please see 3 attachments showing the current layout, the preferred layout (which I mocked up in Excel) and the chart settings screen.
The chart is working OK i.e. 4 slices appear and they are the right size, but when I open the chart, I see only East, West, North. So I am unable to manually set the colour for the 4th slice.
When I export a report to Excel, a memmo field is truncated to 256 characters. If I export the query behind the report, the memmo field is exported correctly. Is there a way to export an Access 2003 report to Excel and maintain all of the data and report formating in memmo fields?
I am building a replacement Access 2013 database for our ageing Access 2003 database. I have an invoice form with a subform with a combo box that allows me to select which jobs to invoice based on the customer selected in the invoice form, which is working fine. I have designed my invoice and have the criteria [Forms]![Invoice]![ID] in the report query so that it just selects the record that is open in the invoice form. I have an ID (which is the invoice number) group on the report and it is then sorted by date and then job number. I thought it was all working fine when I tested it, it is the same method as I used in the 2003 database. However I have a problem, when I make up and print the customers first invoice it works fine, but when I go to make up a second invoice for the same customer the invoice includes all the jobs from the first invoice as well, and if I then go to reprint the first invoice all the jobs from the second invoice as there as well.
In Access 2003 I have a form, at the footer of which I want to put some summary information. One of which is a count of the number of purchases over £500. I have tried many variations after searching the posts on this site but the only one which does not return me an error of some kind with the expression is
=IIf([Bought For]>"500",Count([Bought For]),0)
where 'Bought For is the reports listing of the purchase prices in a given date range when opening the report, but the value returned in my test is '0' when it should be '2' as the test file has two purchases of over £500.
I am using Access 2003 and Google Chrome on my new(ish) laptop.
I have 2 forms - one collects postcodes from the user the other displays the results on google maps. This has worked ok on MS explorer but when I try to use this on my laptop i get "Script error on the Goolge map" I have attached a screen shot and the code.
Private Sub GoogleMaps_Click() DoCmd.Hourglass (True)
'I'm not allowed to post links so have added spaces in the next line...
MyGoogleMapURL = "http : / / maps . google . com / maps ? q = from : " MyGoogleMapURL = MyGoogleMapURL & Me.[ClientPickupList].Column(2, Goog1)
I am trying to build an event when I double click a field. As soon as I click on Code Builder, access crashes. It does this with every access database I open.
I've posted this on a couple other forums with no nibbles. Anyone here wanna lend a hand?
I have a number of cmdButtons on a Parent Form that changes the SourceObject of a subform. I would like to give the user the option of using the Right Arrow key to SetFocus on the subform. I know I can do this on each cmdButton using the KeyDown event but what I rather do is create a function to accomplish this so I don't have to code each and every button. My problem is I'm new to creating functions, subs and etc. Could I get someone to lend a hand in accomplishing this, please?
I'm using an unbound text box and a command button to filter a list of contacts on a continuous form. The continuous form has a query for the record source and the list ends up showing only what is in the strWhere filter
Me.Filter = strWhere Me.FilterOn = True
Is there a way to have Access 2003 take this filtered list and populate the To: field in Outlook or whatever the default mail client is? Each email needs to be deliminated by ";"
I'm trying to extract information from Err.Description within a form's Error event. Alas, Err.Description does not seem to be available from there.I have a form that normally displays in DataSheet view. If a trigger on the Oracle back-end raises an error, I want my Access app to be able to parse out Err.Description and deliver a more user-friendly message than ODBC's message. I want to get the info about the message from the error coming back from Oracle, not by matching up error codes.
If I change the form to Single-Form view and put a Save button on it, I can capture Err.Description in the command button's Clicked() event, and then parse out what I need.So if I must display this form in Datasheet view, where can I trap the ODBC error and display my user-friendly message?
I am using the following dialog box to ask whether or not the user wants to print the report in the Close event of a report. I really need help finishing the code. As the user presses "X" to close the report, I would it to be that if the user says yes...the report prints. If the user says no...the report closes.:cool:
Private Sub Report_Close() Dim Msg, Style, Title, Help, Ctxt, Response, MyString Msg = "Print the Report?" Style = vbYesNo + vbQuestion Title = "Report" Help = "DEMO.HLP" Ctxt = 5000 Response = MsgBox(Msg, Style, Title, Help, Ctxt) If Response = vbYes Then
I have a report that runs code in Report_load, and based on the value of a field it sets some objects Visible=False and others Visible=True etc..
Now I'm trying to move away from acViewPreview and print direct to the printer with acViewNormal but the Report_Load event doesn't run. Is there a different way to run that code when printing directly?
I have parameter form that ask for state and begining date. on click it runs a query and creates a report by state that has multiple pages.. I want to create a separate pdf file for is page (which would be by delegate_name).
This is the coding I have so far and am gettting the error '424' object required. This is the coding I currently have. I haven't worked with access in over 9 yrs so am a little rusty with it.
StateAbb = Me.State PeriodStartDate = Format(Me.Period_start_date, "MM-DD-YYYY") Dim strSQL As String Dim db As Database Dim rs As Recordset Dim strRptName As String
I have a database of musical events. Now im creating flayers for each event. My Q is how the Information for each event should fit on one A4 page and should start on a new page of the report.