Hello to all,
I created a dynamic report based on cross tab query, the header is a sub report.
Number of lines and rows depend on the data typed in a form.
Here is my problem. When numbers of rows exceeds for exemple 15 the header and detail line continue on the line below i would like the report continue on another page (see below).
I have a form that shows a list of all of my records in my database. I want to be able to click a button called "Report" and have that print a report that has all the records I have filtered on my form. I have a report in the format that i want it in, however, currently it prints every record and not just what is shown on my form. (The form is dynamic and I want the Report to be dynamically based on the form) HELP PLEASE!
I am using the following cde to generate a Dynamic Crosstab Report. I can get the column labels to work but Ican't get the values to appear in the detail section all I get is #Name? I am using the following code in the report
Private Sub Report_Open(Cancel As Integer) Dim rst As DAO.Recordset Dim db As DAO.Database Dim i As Integer Dim j As Integer Set db = CurrentDb Set rst = db.OpenRecordset("select * from test2") rst.MoveFirst j = 0 i = 0 For i = 0 To rst.Fields.Count - 1 If rst.Fields(i).NAME Like "*test" Then GoTo skip_it j = j + 1 Select Case j Case 0 Me.Field0.ControlSource = rst.Fields(i).NAME Case 1 Me.Field1.ControlSource = rst.Fields(i).NAME Case 2 Me.Field2.ControlSource = rst.Fields(i).NAME Case 3 Me.Field3.ControlSource = rst.Fields(i).NAME Case 4 Me.Field4.ControlSource = rst.Fields(i).NAME Case 5 Me.Field5.ControlSource = rst.Fields(i).NAME Case 6 Me.Field6.ControlSource = rst.Fields(i).NAME Case 7 Me.Field7.ControlSource = rst.Fields(i).NAME Case 8 Me.Field8.ControlSource = rst.Fields(i).NAME Case 9 Me.Field9.ControlSource = rst.Fields(i).NAME End Select skip_it: Next i rst.Close Set rst = Nothing End Sub Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer) Dim rst As DAO.Recordset Dim db As DAO.Database Dim i As Integer Dim j As Integer Set db = CurrentDb Set rst = db.OpenRecordset("select * from test2") rst.MoveFirst j = 0 i = 0 For i = 0 To rst.Fields.Count - 1 If rst.Fields(i).NAME Like "*test" Then GoTo skip_it j = j + 1 Select Case j Case 0 Me.Label0.Caption = rst.Fields(1).NAME Case 1 Me.Label1.Caption = rst.Fields(i).NAME Case 2 Me.Label2.Caption = rst.Fields(i).NAME Case 3 Me.Label3.Caption = rst.Fields(i).NAME Case 4 Me.Label4.Caption = rst.Fields(i).NAME Case 5 Me.Label5.Caption = rst.Fields(i).NAME Case 6 Me.Label6.Caption = rst.Fields(i).NAME Case 7 Me.Label7.Caption = rst.Fields(i).NAME Case 8 Me.Label8.Caption = rst.Fields(i).NAME Case 9 Me.Label9.Caption = rst.Fields(i).NAME End Select skip_it: Next rst.Clone Set rst = Nothing End Sub
What else do I need to do to get data in the detail section In anticipation
I’m creating a report on which I want to group data base on a field that has two different data one is KEY and OTHER. Now I need to be able to show on the detail section all records base on KEY, and group the rest of the records by OTHER.
I have a crosstab Query as the source for my report, of course the issue is the column headings on the report. I have Purchasers as a row heading, Year as a row heading, Month/Year as a row heading, Meter as a column heading, PaidMCF as Value and, a total as a Row heading. My issue is feeding the column headings on my report with the meter names.
Purchaser 1 has 23 meters attached Purchaser 2 has 1 meter attached Purchaser 3 has 6 meters attached Purchaser 4 has 2 meters attached Purchaser 5 has 16 meters attached Purchaser 6 has 11 meters attached.
I created a dynamic crosstab report with 4 unbound fields in the details section and 4 unbound fields in the header section, which all work perfectly well. The crosstab query contains 17 columns. The last 4 columns contain the values I need to take the sum of. I have put some code in the open event procedure of the report.
Private Sub Report_Open(Cancel As Integer) Dim rs As DAO.Recordset Dim db As DAO.Database Set db = CurrentDb Set rs = db.OpenRecordset("Select * from Que_ProjectUren_Sel_Dept_Test")
I'm currently creating an invoicing report for a company, and for record purposes they need a dynamic field on the report for the specific Invoice Number of each client they invoice. I have the field set up currently as a text box =[Invoice#] so they have to enter an invoice number when they generate the report. However, when I generate the report and put in a number, I'm getting some whacky outputs.
For example, I've tested it with a test client, and when I give the client an invoice number of 1, the report somehow changes it to 49.
I have a button that opens a report. The code behind the button builds the filter criteria for the report based on some selections in a list box.
Code: DoCmd.openReport "Report", acViewPreview, "", GetCriteria For VarItem = 0 To Me.List2.listcount - 1 strCriteria = strCriteria & "([ProjectNo]= '" & Me.List2.Column(1, VarItem) & "' And [ClientID] = " & Me.List2.Column(0, VarItem) & ") Or " Next VarItem If strCriteria <> "" Then strCriteria = Left(strCriteria, Len(strCriteria) - 4) Else strCriteria = "True" End If GetCriteria = strCriteria
This is what the filter would look like with values after running the report (taken from filter bar in report properties):
([ProjectNo]= '150002' And [ClientID] = 206) Or ([ProjectNo]= '150003' And [ClientID] = 79)
Problem is that i only get records for ([ProjectNo]= '150002' And [ClientID] = 206). I this seems only filter ONE set of criteria ignoring all the others. What am i doing wrong?
Is it possible to generate a report from 2 listboxes?
I have attached a pic of what I am trying to accomplish. I am wanting to have a report open with only the criteria that a user selects from the listboxes.
listbox 1: User selects a case number(s)
listbox 2: User selects the fields they would like in the report
So, if the user selects:
Case number: 13-001
Then selects fields:
Allegation Incident date Focus_Last name
This report would be:
Code: Case Number Allegation Incident Date Focus_Last Name 13-001 DUI 06/01/2013 Doe
I have a master recordset containing sales data for numerous products. I'd like to create a dynamic "dashboard" (i.e. a single report or form that the user can interact with dynamically) where the user can click a product name from a ListBox and see a summary report generate in the space below. If they click a different product name from the ListBox, I'd like the report space to automatically refresh and show the next summary report.
I've created my desired report and dragged it into the form but I'm having trouble embedding it dynamically into the form: I tried using the "Link Child Fields"/"Link Master Fields" properties, but get an error message saying I can't build a link between unbound forms. Here's a screenshot what I'm trying to accomplish...
I've made a crosstab query and would like to use it to create a subreport. In the column headers I have names of courses. Courses can be added or removed. How can I make a crosstab report with dynamic columns?
I have made a cross-tab query which works fine. I also have made a report which is based on this cross-tab query. Due to nature of the cross-tab query the Value column(s) is dynamic. The report I made is based on all available data types (columns). The report works if all data type is available but the report fails if some of the data types are not available (i.e columns are missing due to not having any value or data). I hope I am explaining this correctly,
Is there a way I can use expressions in the report to place a conditional clause that if the Control Source doesn't exist place a Null or 0 in the report or in its place.
I have created a database and have a form (searchpartsfrm) with multiple combo boxes and a text box that builds up all the entries and creates a perfect SQL statement and stores this in strisql variable.
I have a report (showallpartsrpt) embedded on the page that is currently showing every record in the database.
Is there anyway to have this form "refresh" and show only the results of the query by clicking a "search" button?
I believe I need to use the filter command somehow but im not sure how to reference the embedded form. If I try with some test code it cannot locate showallpartsrpt.
This code runs to the set frm part then i get a type mismatch? ive tried a few different things and still nothing?
Code:
Private Sub Report_Open(Cancel As Integer) ' Create underlying recordset for report using criteria entered in ' EmployeeSalesDialogBox form. Dim intX As Integer Dim qdf As QueryDef Dim frm As Form ' Set database variable to current database. Set dbsReport = CurrentDb
I'm still learning Access 2010 and having issues getting my buttons to work. I'm working on a simple address database.edit/save button. On form load, my fields are locked and my button will read "edit". After clicking, my fields are unlocked, my search features are locked, and my button reads "save" just how I need it to. The issue happens when I try and save the field edits, lock fields, return search features, and get button to read "edit" again. I know I need to add some code into what I already have, but I'm running into a wall as I have tried many options to get it to work. Here is the code for this button:
Code: Private Function Lockdown() 'locks controls at load Dim tb As Control Dim cb As Control Dim subf As Control
[code]...
Second issue is with my report button. I have not been able to get this to work once. I have done many searches on single record reports, and have found the same code every time. I added that code into my database, but can't seem to get it to work. In my database there are two address (shipping and work location) which I would like to print out together. I have the work location on the main form and the shipping on a subform. There are and upwards of 150 locations I will have in my database, Here is the code I'm working with:
Code: Private Sub cmdrptadd_Click() Dim strReportName As String Dim strCriteria As String
Hey, I made a table Products: order number (key), name, supplier, price,... I copied it into a query, and made a form of it, so I can look up products by order number with a combo-box. Now I'm into my next step (and it gives me a headache): In the form I added a new text box, where I should put the incoming amount of a product in, and another text box to put in the products that are empty. Now the question: how can I make a query that counts the amounts of incoming and empty products, as well as the difference between those two, in a way I can do multiple additions? I hope you know what I mean by dynamic sum: start stock=0 first delivery: +3==> stock 3 +next delivery: +6 ==> stock 9,...
Hi guys, I am trying to create a form or subform that should be created after a button is pressed and some complex filetering is occured and records are saved in a multiple arrays so I need to generate a form and controls according to those array values. Please help.
Actually I can not get data directly out of the query its just too complex bla bla bla. Finally I have three arrays each array has same number of values and I want to generate a form on the basis of the values of the array. Please Help me. I have tried creating form but Could someone please show me the right path.
Now, I don't know if this topic should be in forms, queries or reports, so I decided to post it here in general until someone gives me a big bollocking and send this topic elswhere :D
I have a table with loads (50+) of columns which hold information about people in our company. What I want is a form? that allows me to tick the information I want and then displays the result in a report. So, today I want a list with Name, address, town and phonenumber, but tomorrow I might need a list with Name, phonenumber, passport number and expire date. In short, I need to make a 'dynamic'? report that displays the options I ticked out of the 50+ options (does this make sense?). I searched for it but no luck so far. Ta in advance
Categories contains one field: CategoryName Subcategories contains two fields: ParentCategoryName and SubcategoryName.
In a third talbe I want to select a category from a listbox, then have the subcategory listbox update automatically with the possiblities. Is this possible?
Not sure that this fits under table but I believe that is the root of the solution, so we'll try it here.
I'm building a database to simplify the process of creating a PC build sheet for my company. I would like it to track pricing and everything as well so here is where the problem comes in:
Say right now a floppy drive costs our customer 10 dollars. In a few months, we could still be using the exact same floppy drive, but the price has dropped to 9 dollars. If I run a report to display all computers sold in the past year (including pricing), I want the floppy to have the price that the customer paid at the time; not the latest 9 dollar price only.
Correct me if I'm wrong, but here is my thinking: I could run a macro to rename the $10 floppy drives and update it in all old records (though I have a feeling I'd have to pull a trick out to mess with UIDs) then update the price on it for the list of options when building out a computer, but it seems like I should be able to automate this better.
Possibly some sort of linkage table?
I'm just trying to keep this as clean as possible so I'm not digging back through this a year down the road.
i have a database that imports files with dynamic amounts of fields, runs querys on the data and outputs it to a speadsheet. The The problem is instead of making it run querys on each column, i have it running on them all collectively. Now i want to change it so a query is run on each column then output to its own spreadsheet. Does anyone know how to do this?
Dim Db As DAO.Database Dim QD As QueryDef Dim where As Variant
Set Db = CurrentDb()
' Delete the existing dynamic query; trap the error if the query does ' not exist. 'On Error Resume Next 'Db.QueryDefs.Delete ("Dynamic_Query") 'On Error GoTo 0
where = Null where = "WHERE ((([(Table) Denton Routing].UNIQUE_LANE_ID) In (SELECT UNIQUE_LANE_ID FROM [(Table) Denton Routing] where" where = where & " [(Table) Denton Routing].[Location_ID]= '" + Me![Text35] + "'" where = where & " AND [(Table) Denton Routing].[Final_Dest]= '" + Me![List29] + "'" where = where & " AND [(Table) Denton Routing].[Ship Day]= '" + Me![Combo46] + "'))"
Say I have 3 fields in my table: FstName, MidName, LstName.
I want to be able to dynamically change the sort order of a query to different sort orders using the same fields via a form.
I may want to see the records sorted by LstName, MidName, Fstname; and another time see the list sorted by Fstname, Lstname, MidName; and other times by any combinations possible using the 3 fields.
I see 3 options: filter by form; programatically change the SQL Order By clause; or concatenating the table fields together in the desired order via a custom function and sorting by the function result.
Is there any difference in query/form performance between the 3 options?
Hi all, I'm currently strugging with an Access problem and wondered if anyone here could give me some ideas. This is fairly complicated to explain, so please bear with me!
Basically, I have a query that pulls out a list of users, and another query that pulls out of a list of possible applications that that may be assigned to them.
What I need to do is present this in a form, so that my app user can browse through the list of users, and assign/deassign applications to that user. I'm thinking of presenting this along the lines of a list of users down the left of the screen, a list of apps along the top of the screen, and a checkbox for each app/user combination.
The complication is the list of possible applications is different every time the form is loaded. There are 1500 possible apps, and ANY combination of these may be available.
My most recent attempt at this was to find the list of apps, and then (using vba) create a temporary table, with a "User id" field, and then a "yes/no" field for each app that is available to this group of users. I can then present this in a subform, allowing the tickboxes to be viewed and modified for each user/app combination.
However, my problem is that when I dynamically try to alter the recordSource of the subform, the field names are different each time, so it doesn't display the app names I need. I've searched Google etc, and the only relevant suggestion is to have multiple subforms, and display the one that suits. However, with such a huge number of possible combinations of apps, I cannot take this approach.
So, is there any way that I can easily update the subform to have the correct columns? Or am I going about this in entirely the wrong way?
Any suggestions will be gratefully received - I'm hitting a brick wall with this at the moment and don't have much hair left to pull out!