Order By In A Report Dynamically
Oct 31, 2004How do I let users choose the way they want to sort their reports through a form dynamically?
View RepliesHow do I let users choose the way they want to sort their reports through a form dynamically?
View RepliesI 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.
I have developed a database using Access 2010. This is split into a Front End and a Back End.
In the same folder as the Back End I store a number of user modifiable files in either bitmap (.bmp) or MS Word (.doc to retain compatibility with older versions).
Unfortunately, the drive letter where the back end resides will change from location to location and I can't do anything about that.
I have set up a function that returns the location of the folder where the docs reside irrespective of the back end drive location, and this works perfectly with OLE linked pictures but not with OLE linked Word documents. User changes show correctly in Word document changes at locations with the original drive assignment but other locations show only the original doc contents even though they have been changed on the local back end location. - even if I delete the Source Item info on the report!!
An example of the code I am using for the Source Item is <GetBackEndPath() & "Footer.doc"> without the angled brackets of course, where GetBackEndPath() is a global variable storing the location of the documents folder ending with a back slash.
I have tried the above in the reports Source Doc property but Access won't accept this and says it isn't valid for this property.
I have created a report from the information submitted on a form. When I pull up the report, I would like it to sort differently than it is. I am not sure what it is using to sort from but I want it to sort by a designated # I have assigned it.
Is there a way to make it so the access's record # will always match our companies record #?
Today I entered information in a form that should have gone in as record 96 but when I went back to look at the record in the report, it was record # 72. ??????? Now what do I do?
I have a cool little form for the use of the organization's treasurer wherein she enters checks and deposits. I have a query that generates a running sum, so each line in the accounting report based on the table has the account total as of that date. The query behind the report is exactly what I want and is in the correct order. For example, the four transactions for 9/15/2014 are in the order entered, and the line total is correct. The report insists on listing the 4 in the example in some other order with or without OrderBy specified. With code from someone, perhaps on this forum, I added the following to the OnPage event:
Code:
Private Sub Report_Page()
Const TWIPSPERINCH = 1440
' Offset from right edge of Control where our
' Vertical Line will start - adjust as you desire.
' Expressed in Twips
Dim intLineMargin As Integer
[code]....
The result is a beautiful report (albeit in the wrong order) with vertical lines all the way to the bottom of the page.If I remove the OnPage code, the report is still in the wrong order, so obviously that wasn't the problem. OK, I think it is corrupted. I open a new db, import all into it. Still in wrong order. So next, I begin to recreate the report from scratch. Hooray! Right order! But I still want the vertical lines between the columns. So now, I copy the OnPage code and paste it into the new report's OnPage code. I get error message: "Compile error: User-defined type not defined" with the line "Dim MIPSstr As udtPrtMips_str" highlighted. Ok, I delete all of it and reenter it line for line manually, leaving out the comments. Get the same error message. After trying to research it, the only suggestions were to add Activex reference which can't be the problem, because the other version of the report doesn't throw an error and both are in the same db.
I have attached a clip of the report and a clip of the underlying query. As you can see in the first capture.png, the check numbers are in the wrong order and the amounts in the Total line don't sync with the total above adjusted by the amount on that line.
Need help pls
I'm designing a report that should be sorted by field A, B, C, D, or a combination of BD or CD.
Problem is (it seems) the report ignores the sort order and lists the results in ascending order of the autonumber field - 1,2,3,4,5 etc.
The reports run off queries and the queries work fine - they sort the fields in the proper order.
Is the autonumbering somehow interfering with the sort order in the report?
HELP!!!
I have a report that generates the position of certain items. When I produce this report it doesn't put the data in order. All associated data with that position is correct, it is just not in numerical order. The attached screenshot shows the issue I am having. In the position column it should read 1,2,3,4 but in some cases the positions are not in order.
View 2 Replies View RelatedI have report which record source is a Union Query, The query contain Order Details and a single row for "Freight Charges", I just want to set Freight Charges show in Report at last row.
View 3 Replies View RelatedI have a Report that uses a query as it's record source. I have the query ordered by a field, which works as expected in the table view of the query. In the report, however, the ORDER BY clause does not seem to carry through. The field is not sorted Ascending. What's going on?
View 5 Replies View RelatedI have a problem getting pages of an Access 2002 report to print in the correct order.
I have a report which prints one of four pages per record. The data source for the report was initially sql which retrieved records from 2 tables. The sql was working fine. The order of the records was set by the ORDER BY clause. ORDER BY ON is set to Yes. ORDER BY is set to a text field called SortKey. Because the report was not printing the pages in the correct order, someone suggested that if I create a table (I called it SortReports), make sure that the table is sorted by SortKey, and make the table the data source, it should work. But it does not.
The pages in the report still do not follow this sort order. I have also made SortKey the primary key field. No matter what I do, the report continues to sort by another field called SystemKey, as well as something else. I have been looking at Microsoft and other websites for a similar problem and solution, but no luck yet. Any ideas?
I would greatly appreciate any help, or a push in the right direction.
Thanks.
I have a main report / subreport relation, just want to have a fixed length of each printout. e.g the total number of lines of the subreport should be 8 lines. However, lots of subreports contain records less than 8. I would like to know how to insert of blank line in the subreport depending on the records with content at each print, in order to make the total number of lines in each subreport is 8 each print!!
View 1 Replies View RelatedI've been asked to edit a current report that lists our production in week number order. I need to look at way we can 'flag up' orders that are within a 4 week period from the current date.
For example,
10 Orders in total in our database. 5 of which are due the drawings back within 4 weeks from today (26/02/15). I'm looking for a way for the report to show the 5 orders as priority, either by formatting the orders in bold, a different colour or under their own heading/group.
hi,
I have noticed something kind of strange about one of the reports I have created. My report is based on a query that goes through multiple tables. The report seems to work fine, except that whenever I check the "properties" of the report, I have a value in the "order by" field. It is populated with a field that I would never sort by in the first place, so I don't think I ever put it there. I delete it, and it comes back when i close the report and re-open it to check the properties. What is that about? How do I fix it?
thanks !
This may be a really straightforward one but I cannot seem to find a solution.
I need to run a select query, (for a mailout) then mark the records that have been selected in the query on the main database table with a mailshot code.
Any ideas on how best to achieve this?
I was thinking of making the select query maketable (because I have to export a txt file of email addresses for a mailing list), then add a mailshot code field, then append this extra field to the main table.
The trouble is that I am not sure how to use the query to add this extra field to the maketable & once this has been done, how do I append the values to the original table when the mailshot code field does not exist, can it be dynamically created?
Any help will be much appreciated.
Hi,
I have a subform called "Earthwork". I also have a query called earthwork200 and I need to dynamically transfer data from the earthwork to the query based on a certain column.
for example, the earthwork column i am using to transfer data to the query is "Desc" (the name of the column). How do i get data to dynamically goto the query as I click on a new item under the "desc" column?
Kindly HELP!!
Hi All,
I have built queries based on tables. The field names are the technical field names of an application. For example pernr is actually Personnel Number etc.
My queries are set up as follows:
Field = pernr
Table = etc
I would like to rename pernr to Personnel Number so that the column heading in the datasheet view is Personnel Number.
I know I can do this manually for each query by using the following as the field: Personnel Number: pernr
Is there any way of getting this be done dynamically using a lookup table etc. I have lots of queries and I don't want to manually change them all. Furthermore, if I wanted to rename Personnel Number to Personnel No. then I could do it in the mapping table rather than in all the queries.
Thanks,
Evan
Hi Guys
my database is essentially a questionnaire of around 200 questions. I'm trying to add a 'light' version to it.
I've added a 'include in light verion' tick-box to all the questions and a 'light analysis' tick box on the registration page.
The questions are all genertated via queries pulling out the appropriate ones as required. What I'm tying to do is add to these queries so that if the 'perfomr light analysis' tick box is ticked only those questions that have been indicated as light are included, and if it's not all teh questions are included.
I can do either-or but not both dynamically
Can anybody help?
Thanks
scube
I don't know if anyone can help me with this one at all.
I have a query that contains all the possible data that my users will wish to get data from but I want them to have the option to show/hide particular columns to make the query ad-hoc.
I have some code that copies my query to another of a unique name during the course of their Access session so they end up with a query with the name 'ABC' for example that they can run.
If this query ABC has columns A,B,C,D which are all defaulted to be shown and the user decides they are not interested in columns B and C is there Access code that is equivilent to this pseudo-code?
ABC.A.Show = True
ABC.B.Show = False
ABC.C.Show = False
ABC.D.Show = True
where ABC is a query, A..D are columns and Show is the checkbox in the query definition.
That I can run in VB 6.3?
Aenathras
Hello Guys,
I have proj name m1.mdb which has forms and reports.I have 2 forms form1 ,form2.In form2 I have button that creates new database named m2_date.mdb and creates report and form1 by using property DoCmd.TransferDatabase acExport, "Microsoft Access", sFilename, acForm, "form1", "form1", StructureOnly, StoreLogin,now this form1 has to be seen first when any user doubleclicks m2_user.mdb,so my question is, is there any way i can setup startup form properties dynamically ,without using startup form manually from tool properties of toolbar.
hope to get answer..
thanks
vsap
I have a form that has several rows of controls (comboboxes, textboxes, checkboxes, etc)
Each row is exactly the same. There is one row for every 'driver' in the 'SalesDrivers' Table.
Instead of manually adding a row when we add a new driver I would like to form to dynamically create the form based on the drivers in the table.
Any suggestions?
sorry if this q has already been asked, but i couldnt find what im looking for after searching..
i have a main form. there is a combo box that is that is bound to tblSupplierDetails. this combox displays the records stored in tblSupplierDetails fine. now beside this combobox i have a hyperlink that opens a subform called 'subfrmAddNewSuppliers'. this subform works correctly - ie. when details are entered here, they are stored in tblSupplierDetails
my prob is that if the user adds new supplier details via the subform, these details do not appear in the combo box for the user to select when they are returned to the main form.. they appear if the form is restarted
Ive inserted the statesment Me.ComboBoxName.Requery (with ComboBoxName ammended) into the event procedure for After Update for the combobox.
however, with this the new details which are added via the subform are replacing the previously added record - so theres only ever one record in tblSupplierDetails.. can someone pls help me with this?
I have a database that has a field [country] that stores the numerical id of the country from a table of countries. The student table also has a field called [mother tongue] and it seems to me that this is duplication.
I created a simple query based on a link table that tells me the country and its associated mother tongue.
SELECT [-LOOKUP-ALL-Country-LinkToMotherTongue].Country, [-LOOKUP-ALL-Country-LinkToMotherTongue].MotherTongueLinkNo, [-----LMotherTongue].Language
FROM [-----LMotherTongue] RIGHT JOIN [-LOOKUP-ALL-Country-LinkToMotherTongue] ON [-----LMotherTongue].[Reference no] = [-LOOKUP-ALL-Country-LinkToMotherTongue].MotherTongueLinkNo;
It seems to me to be an overhead to store in the student table the mother tongue id.
How can I create a text lable that dynamically shows the mothertongue as i move over records?
that way the user can see the students mother tongue but I only store the country table and link table to mother tongue. as opposed to a mother tongue entry against all students.
regards in advance
Peter
Hello Access heroes..
I'm using the following code to dynamically link to images in a popup form:
thisPicString = GetPath(CurrentDb.Name) & DLookup("details", "infoTbl", "Item = " & Chr(34) & "Image Folder" & Chr(34)) & ""
MsgBox thisPicString
Me.Image1.Picture = thisPicString & "DNA.gif"
Me.Image17.Picture = thisPicString & "wDNAslogo1.gif"
Me.Image18.Picture = thisPicString & "defralogo1.gif"
The thing is, it finds the images fine, but before it does this I get an error saying Access cannot open the file name xyz.
xyz is the path the picture has originally, but doesn't exist anymore.
Any ideas? I've tried this code at _Open, _Load and _Current, but all to no avail. At what point is access trying to link to these images? Can I get the code in there first?
Cheers,
Hi, I am new to asp development and have been searching all through the web and books to help me but I am a little stuck and would appreciate some help please with updating a second combo box.
I am developing an online fault logging system for a school where the teachers/pupils can report a fault with any computer equipment to the technicians so they then can fix it.
I have two combo boxes called ResourceType and Resource ID which are created and populated from two different tables in an Access database (I dont want to annoy you with the code but if you like I can show you)
When ResourceType combo is selected it should automatically update the ResourceID combo from a table in the database. eg. ResourceType=Laptop then ResourceID should be populated with all the entries in the DB which correspond to Laptops, i.e. Laptop001, Laptop002 etc.
ResourceType combo is populated from table tblResourceType in the Db and ResourceID is populated from table tblResourceID. This works fine when the page is first loaded but I have problems with the onChange="handleChange(this)" function for the ResourceType combo. It is :
Code:function handleChange(nSelection){var IDSelect,iCountIDSelect = document.form.ResourceID //Reset the ResourceID combo contentsfor(i=IDSelect.length; i>0;i--){ IDSelect.options[i-1] = null} //Open Database<%set db=server.createobject("adodb.connection")db.Open"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("MCB Fault Log.mdb")dim dbaseset dbase=server.createobject("adodb.recordset")%> <%Dim iCount 'counter variablesSQl = "SELECT ResourceID from tblResource"dBase.Open sSQl , db%> //Reset Counter iCount = 0<%do while not dBase.EOF%> IDSelect.options[iCount] = new Option(<%=dBase("ResourceID")%>);//********This does not work****** //IDSelect.options[iCount] = new Option(iCount);//***HERE**This works (places the count of each record in the combobox iCount = iCount + 1; <%dBase.MoveNextloop%>}
Dont worry about the SQL statement for now, I am happy just for any table to fill into the combo. Look at the //********This does not work****** line - I think I have the syntax wrong, I have looked at lots of examples on the net and I cannot find one similar to this. The line ***HERE** places the number of the count into the combo box so at least i know the the database is being accessed.
Does anyone know what is going wrong here.
Thanks in advance for any help you may give
Cush
Hi,
Does anyone know how to add controls to a form, dynamically??
got the following issue:
There are two tables A und B.
Table B contains columns like 1FC, 2FC,...., 12 FC
standing for forecast sale quantities.
Now I want the user to decide how many FC columns he wants, always starting with 1FC.Let's say he wants three FC columns.Now I want to map these 3 FC columns to the table A. Both tables contain column Product_Classes.Can I shrink table B to the 3 FC columns ?