Sorting A Resulting Table Of ComboBox

May 2, 2007

hello,

I have a combo box that looks at a table with an SQL statement. In the form, the combo box shows the headers of the resulting table. Is there any way that the user can click on any header (let's say 'LastName' or 'Date' ) so the drop down list would be sorted by that header that the user clicks on??

Thank you very much

View Replies


ADVERTISEMENT

Queries :: Adding New Field To Resulting Table

Jul 2, 2013

I am looking to create a query that adds a new field to the resulting table. The field should be 'Yes/No' and for every entry the default should be 'Yes'. The query looks something like this:

Code:

Select .*, [here the new field]
From MyTable1
Union
Select .*, [here the new field]
Form MyTable2

The Union statement isn't really relevant, just for completion's sake.

View 6 Replies View Related

Forms :: Sorting Combobox Displayed Value

Jan 19, 2015

I have a combobox which lets you select from a list of pseudonyms. Each pseud belongs to an author; authors can have multiple pseudonyms and exactly one main pseudonym. This is the table structure (picture of relationships attached below):

Code:
tblStory: StoryID (PK), AuthorID (FK), Title, etc.
tblAuthor: AuthorID (composite PK, autonumber), MainPseudID (composite PK)
tblPseud: PseudID (PK, autonumber), Pseud, AuthorID (FK)

The combobox list shows all the pseudonyms and then stores the corresponding AuthorID. At the moment, the pseudonym displayed in the combobox (once a selection has been made) is simply the first alphabetically for that particular author: for instance, if a story has AuthorID = 5, and Author 5 goes by anon, anonymous, and unknown, the combobox for that story will display "anon".

How can I make the main pseudonym (tblAuthor.MainPseudID = tblPseud.PseudID) be displayed instead?

Control source is tblStory.AuthorID

Row source:

Code:
SELECT tblPseud.AuthorID, tblPseud.Pseud, tblAuthor.MainPseudID
FROM (tblAuthor LEFT JOIN tblPseud ON tblAuthor.AuthorID = tblPseud.AuthorID)
LEFT JOIN tblStory ON tblAuthor.AuthorID = tblStory.AuthorID
ORDER BY tblPseud.Pseud;

View 1 Replies View Related

Forms :: Unbound Combobox - Sorting List Of Files

May 19, 2014

I have a BackUp and Restrore from BackUp procedure in my my database.

I can backup to a spreadsheet and the spreadsheets are renamed to include the date of the backup.

When I restore from the backup an unbound combo is populated

Code : Set SourceFolder = FSO.GetFolder("c:GPandDetectionDogTrainingLogBackUp")

This all works, the only issue being, is that I want the most recent backup to be at the top of the list, at the the moment its at the bottom.

is there a way of implementing a sort order, bearing in mind that its an unbound combobox.

View 5 Replies View Related

Sorting A Table, Apply The Sorting To A Form

Mar 10, 2006

Hi all.
I've created a database which contains information about stores. I want to have the forms automaticly sorted by the department number.
I've tried to sort the table by department, but when I try to add a department, the sorting doesn't seem to affect the form at all.

Lets say I have department 1,2,3,6,7,8 in the form, and I add department 4, it will be the last post in the form. I want it to be the fourth, and so on..

I'd apreciate some help with this :) Thanks

Here's the database (http://www.access-programmers.co.uk/forums/attachment.php?attachmentid=12934&stc=1&d=1142018915&PHPSESSID=f730b7f11f6983965698faeacbe5a1ee)

View 5 Replies View Related

Compact Resulting In Copies On The Network

Nov 28, 2007

I tried the search and while I found some things related to my issue, I couldn't really come to a conclusion on my issue.

I have all the databases on the network set to compact on close. This is resulting in a new copy of the compacted database with the generic "db1.mdb" file name every time the db is compacted. It also does not compact the correct one.

So, basically...it is copying the db, compacting it, but not deleting the old one and renaming the new one.

If I copy the database to my hard drive, it compacts, deletes, and renames sucessfully.

The only thing I can think of at this point is there's some issue with the server. But this is happening on multiple servers.

View 14 Replies View Related

Query With Resulting Print Of Letter

Sep 13, 2006

I am assisting with the design of a db, where depending on two criteria, one of two letters needs to be printed. If one check box is positive, a letter is to be generated. If it is empty then a second checkbox will be checked, resulting in a different letter.

I appreciate any assistance.

:o

View 1 Replies View Related

Modules & VBA :: Dlookup Resulting In Null Value

Aug 15, 2015

I am trying to run this code but getting a run time error 94 - null value - when it shouldn't be.I am thinking I have written the Dlookup incorrectly?

Code:
Private Sub txtProductName_Click()
Dim iProdType As Integer
Dim ProductID As Integer
iProdType = DLookup("ProductTypeID", "tblProduct", "ProductID" = Forms![frmBooking]![cboProductID].[Value])
Note ProductID in an integer

How can I diagnose this or what could the solution be?

View 5 Replies View Related

Resulting Date Format In Datasheet Is Inconsistent

Jun 1, 2007

I am at a loss as to why my dates in my table datasheet are not consistent in the Date/Time format. In the table and specifically the Date/Time field it is formatted as the selection "Short Date". I am located in the U.S. using MS Access 2003. The database I'm using was a free download from the MS website called "Accounting Ledger" and it is for Access 2003.

http://office.microsoft.com/en-us/templates/TC010175341033.aspx?CategoryID=CT101426031033

While I have dabbled in databases some I am really at a loss as to why I am seeing two >>different<< Date/Time formats in the *same* table.

Below is the date range I've entered from January 2007 to May 2007 and below has been copied and pasted directly from the datasheet. Trying to do a date sort in any fashion is out of the question until I resolve this.

I am consistent in my date input... April 6, 2007 is entered as 4/6/07, January 18, 2007 is entered as 1/18/07, February 21, 2007 is entered as 2/21/07 and so on.

However, some dates are showing as mm/dd/yyyy format while others are showing as dd/mm/yyyy format.

Note: if I choose a general date or long date format Access reads these as July, September and October dates in some cases.

Here is January (as copied and pasted from the datasheet)

01/03/2007 (these first 7 show a mm/dd/yyyy format)
01/03/2007
01/02/2007
01/10/2007
01/09/2007
01/05/2007
01/11/2007


18/01/2007 (these last 6 show a dd/mm/yyyy format)
24/01/2007
27/01/2007
27/01/2007
02/01/2007
31/01/2007

Here is February's

05/02/2007
02/07/2007
26/02/2007
02/09/2007
21/02/2007
28/02/2007
15/02/2007
04/02/2007

And March's... (the only month that appears correct...)

14/03/2007
17/03/2007
21/03/2007
14/03/2007
19/03/2007
22/03/2007
14/03/2007
15/03/2007

April's....

04/11/2007
04/05/2007
04/10/2007
04/10/2007
04/11/2007
04/11/2007
04/11/2007
04/11/2007
13/04/2007
04/12/2007
04/12/2007
13/04/2007
13/04/2007
13/04/2007
04/04/2007
20/04/2007
04/06/2007
23/04/2007
24/04/2007
17/04/2007
17/04/2007
17/04/2007
27/04/2007
04/10/2007
04/10/2007
13/04/2007
24/04/2007

May's...

05/06/2007
05/01/2007
05/03/2007
05/08/2007
05/09/2007
05/09/2007
05/10/2007
05/11/2007
14/05/2007
14/05/2007
14/05/2007
15/05/2007
15/05/2007
16/05/2007
16/05/2007
17/05/2007
25/05/2007

Any help would sure be appreciated!

Thanks in advance.

Rod

View 4 Replies View Related

Forms :: Hide Form Controls And Resulting White Space

Sep 20, 2013

I have a checkbox that determines whether or not to display certain form controls. How can I also hide the resulting white space that comes from hiding the form controls?

Can I put all of the controls in some sort of container and hide the container? The form objects are all displayed in order, so it shouldn't cause issue.

Can I create a subform for the objects and hide it? This would make the main and subforms based off of the same table.

Occam's Razor would be the preferred philosophy in this case. Nothing too fancy is needed.

View 4 Replies View Related

Modules & VBA :: INSERT Statement From Form Resulting In Run-time Error

Dec 4, 2013

I am trying to create an INSERT statement from a form to put unbound fields in a table. The challenge that I am a getting is that I am getting a

Run-time error '3075' Syntax error in date in query expression '#'

What is really perplexing and perhaps something that may guide in identifying the culprit is that I have an identifcal form that uses the identical code and it works.

Here is the code below:

Dim strSQL As String
Dim strCriteria As String
strSQL = ""
strSQL = strSQL & " INSERT INTO [tblTicket]"

[Code] ....

View 4 Replies View Related

Sorting A Table....

Sep 1, 2006

Hi The beginner here again.....

How do I set a table to sort by specific fields???

ie i have an ID field which is an autonumber, then 6 fields

I want the table to autosort first by a field called [rank], and then by a field called [name]

Thanks in advance

Egg

View 8 Replies View Related

Table Without Sorting

Jan 1, 2008

Hi,

I'm using DAO in C++ to write data in MS Access table. I found that MS Access will automatically sort those records in ascending order based on the primary key. I need to leave those records based on the write sequence, can I do that?

Thank you in advance:)

View 2 Replies View Related

Filtering/Sorting A Table

Apr 19, 2006

Hello,

I have a project table that I track the progress of each job in by entering dates when certain portions are done. What I would like to do is when I fill in the "Project Completed" or "Cancelled" columns, to have that record automatically filtered out of the table. I still want to be able to turn off the filter at the end of the year to see all the projects we did, but I don't want this project cluttering up my table once it is finished or cancelled. Right now, I copy and move these completed projects to a separate table, but others say this is confusing and they can't figure out which table to use.

I input everything in the table format and don't have any forms that I use.

Thanks for any help.

Matt

View 1 Replies View Related

Sorting Field In Table?

Oct 24, 2012

I have a table that i would like to sort the records in one field Ascending.

I would like for the field to be updated after the record is entered so that the records in the field are all ways in a alphanumerical order.

I have put [SSB-CW].Square in the Order BY properties of the table. The Table is called SSB-CW and the field to sort is called Square. As i enter the records they stay in the order entered. When the table has been closed and then re-opened the records are sorted.

Do i need to design a form and set the lost focus property with the SQL [SSB-CW].Square.

View 3 Replies View Related

Text & Number Sorting In A Table

May 24, 2005

I have a table where my primary Key is of a text type, the key is made up of a single letter then a number... ie.

R1
R2
R3
...
R30
R31
..R100

etc.

This is an indefinate table and will go as high as I need to

Unfortunately I can't sort this table because if its mixture of both text and numerical characters, can anyone provide any assistance?

Thanks!

View 5 Replies View Related

Calculating Between Fields In A Table And The Sorting

Jan 27, 2008

Below is an example of my table "Pricedata" include 03 fields:

Stock Name ___Price________Status Date
A________________10________ __1/6/2008_
A________________11___________1/7/2008_
A________________12___________1/8/2008__
B________________22___________1/6/2008_
B________________25___________1/7/2008_
B________________29___________1/8/2008__
C________________2____________1/6/2008_
C________________2____________1/7/2008__
C________________3____________1/8/2008_
D________________56___________1/6/2008_
D________________45___________1/7/2008_
D________________27___________1/8/2008__

I want to create a query like this: can calcualte the price change and % price change in certain period, and then sort in % change.

This result should be like the table below:
StockName Change in three days % Change in 03 days
C 1 50%
B 7 31.8%
A 2 20%
D -29 -51.78%

Thanks all,

View 6 Replies View Related

Remove Sorting From Lookup Table?

Aug 16, 2012

I do not want the look up table for my combo box to sort the data so that the drop down will show the data the the order I enter it. The table automatically sorts the data even with the Remove Sort feature. I added another column with numbers and sorted it to put my data in order which works in the table but the drop down still sorts it alphabetically which I assume is because my number column is not the bound column.

View 4 Replies View Related

Sorting Form By A Field Value In A Table

Sep 4, 2014

I have a table that stores data adn one of the fiels values is direction x or y so we have

|field 1|field 2|field 3|direction|field 4|

For example

Direction x and y will be different records in the parent table

And I want to arrange my data on a form as so

| direction x | direction y |
|field1|field2|field3|field1|field2|field3|

View 1 Replies View Related

Tables :: Sorting Table Field With Lookup

Aug 12, 2015

I have created a lookup in a field in a table:

select id, bike from tblbikes.
Column count 2
Width 0,3

When I try to sort the table by bike:

I receive the following error: Type mismatch in expression.

Is there some way to sort a field with a lookup.

View 3 Replies View Related

Sorting Table / Query - Ordering Numeric Values

Dec 30, 2013

I currently have records that end with a letter and 2 numbers. For example, A1, A2, ... , A10, A11. When I try to sort my table/query by these values, A10 & A11 come before A2. It seems that it is sorting by the first digit shown. Is there any way to fix this quickly within table/query properties so that this can be displayed in proper numeric order?

View 7 Replies View Related

Modules & VBA :: Sorting Out Data To Be Used In Final Table - Runtime Error 3021

Nov 25, 2014

I have managed to sort out the data to be used in the final table. However, I am having trouble transferring the data from each of their own tables into the final table.

Each time I run my code I receive "run-time error 3021: No current record."

It seems that only my timestamp is being added properly, but the error pops up and highlights the first "rstInsert.Edit" of my code. I'm suspecting that my function is running too fast, such that it did not have time to read that the table has already been populated by the timestamp in the AddNew code

Code:
Private Sub Command9_Click()
Dim dbs As DAO.Database
Dim rstTimestamp As DAO.Recordset
Dim rstAcknowledgement As DAO.Recordset
Dim rstAgent As DAO.Recordset

[Code] ....

View 1 Replies View Related

Reports :: Group Data In A Report From Single Table Using Grouping And Sorting

Dec 2, 2014

I'm trying to group data in a report from single table using grouping and sorting and I want the percentile of every record over group total. I'm using a query to fetch data from table, however I'm unable to get percentage of every single record over group total.

I want to display the report as attached image in single report. I'm unable to get data in "Perc" field. It's populating wrong values.

View 3 Replies View Related

Combobox Store ID Not The Corresponding Value To The Table

Apr 17, 2012

I am newbie to access database, I have 2 tables namely business_unit(id,b_unit) and division(id(pk), bid(fk),division) . I have created 2 combo box in my form one for b_unit and another division, based on the selection of b_unit the related division will be loaded in division.

If i try to store the b_unit and division value from the form to the table called "training" it stores only both of the field ID's not its value.

I execute this query ,

Private Sub Command12_Click()
CurrentDb.Execute "INSERT INTO training(business_unit,division)" & _
"values(" & Me.business_unit & ",'" & Me.division & " ')"
End Sub

View 1 Replies View Related

Table Stores Id Instead Of Text With Combobox

Sep 18, 2005

Hella all,

I'm new to this forum :) so I say hello to all of you :)

I have a little problem..

I have a table wich stores information wich comes from a combobox.
The problem is that it saves the combobox ID instead of the text.

This is the row source of the combobox

SELECT rapporteur.ID, rapporteur.rapporteur FROM rapporteur;

Could somebody tell me how I can store the rapporteur.rapporteur in a other table instead of the rapporteur.ID?

thx a ton in advance

View 7 Replies View Related

Table Stores Id Instead Of Text With Combobox

Sep 18, 2005

Hi, I'm new here also. I'm afraid I can't help with your question, but I have 2 questions of my own.

1) how do you start a new thread (as you have done?)

2) in my database I have thousands of contacts. How can I add an alphabetical index tab along the right edge such as in Outlook for one-click access to different parts of the database?

Thanks and I hope you can help!

Gary

View 2 Replies View Related







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