Sort A Lookup Field That Has Dates In It

Sep 14, 2004

I have a lookup field for my table that pulls its data from Pay period table

When I click the drop down in my table, the dates aren't in any order. I think this is because lookup fields are considered text fields.

Is there a way to sort my drop down box on the table?

KellyJo

View Replies


ADVERTISEMENT

Lookup Field - "sort" Problem

Feb 10, 2005

I have used the lookup wizard to create a number of lookup fields across my database. However, according to my Access for Dummies book (!) the wizard should ask me if I want the records sorting ascending or descending. My wizard isn't doing this, and hence my lookup table contains the data in a very unhelpful manner!!! Any ideas?

Just1

View 3 Replies View Related

Tables :: Lookup Field Using Another Multi Value Lookup Field As Data Source

Nov 23, 2012

how to do a particular thing in Access 2010 (I don't even know if it is possible).

I have a table named PRODUCTS:
ID_PRODUCT (primary key, autonumber long integer)
ALLOWED_OPTIONS (multi value text lookup field: "Option 1";"Option 2";...;"Option 9")

So I can store, for each different product, none, one, or more options to let the customers choose from.

I have a table named ORDERS:
ID_ORDER (primary key, autonumber long integer)
FK_CUSTOMER (foreign key, linked to the primary key of a CUSTOMERS table; represents the customer that places the order.)
FK_PRODUCT (foreign key, linked to PRODUCTS.ID_PRODUCT; represents the product that the customer has choosen)
CHOOSEN_OPTION (lookup text field; the customer must choose ONE option among those allowed for the product he has ordered)

The problem is that I would like the CHOOSEN_OPTION field to show as a combobox, listing the values stored into PRODUCTS.ALLOWED_OPTIONS, so that when a customer buys a product, he can choose only among the options allowed by that particular product.How can I manage a multi value field to populate a combobox, in which every item stays on its line? If I use, as a query to populate the combobox:

select [PRODUCTS].[ALLOWED_OPTIONS]
from PRODUCTS
where [PRODUCTS].[ID_PRODUCT]=[FK_PRODUCT]

I obtain an empty combobox.If I refer to the last field as [ORDERS].[FK_PRODUCT], Access asks me to type a value for "[ORDERS].[FK_PRODUCT]", treating it as an unknown parameter.I think that the problem is that when the combobox expands, the record is not committed yet, so FK_PRODUCT is unknown (NULL?). But this happens even if I commit the record typing something in FK_PRODUCT and then I re-enter the record and I expand the CHOOSEN_OPTION combobox, that is still empy although FK_PRODUCT exists, now.Is there a particular syntax to refer to a field in a record not committed yet (something like "THIS." or "ME.")?

View 5 Replies View Related

Forms :: Dates Won't Sort In A Form

Sep 23, 2013

I have a "Date Select" form that is linked directly to a table that only has one column in it, "Dates". The column in the table is a Date/Time column and is sorted in date order, Lowest to Highest, and when any new dates are added to the table (through another form) they re-sort into date order.

The "Date Select" form allows the user to highlight a date and open a record containing information logged against that date, however the dates on the "Date Select" form will not sort into the logical date order that the table that feeds it is in!

I've set the "Date Select" form Property "Order By" to [Datse_List DESC], (Dates_List being the name of the List Box on the form that displays the list of dates from the table), and set the "Order By On Load" to "Yes", but still the dates in the list box remain out of order.

Dates are entered into the table "Dates" column retrospectively / randomly.

how to make the dates in the list box conform to Lowest to Highest?

View 5 Replies View Related

Sort By Date With Blank Dates At Bottom?

Sep 7, 2006

Hi

I have created a query which sorts store information by potential opening dates...however, some of the stores are so new there are no potential opening dates as yet.

I would like the stores with blank opening dates to appear at the bottom but when sorting by ascending (which is what I need) these blank dates appear at the top... is there any way around this?
thanks

View 5 Replies View Related

How To Use Lookup Wizard For Dates

Apr 29, 2014

How does one use the lookup wizard for dates?

It says: The lookup wizard doesn't apply to fields of this data type.

I want a combo box for dates.

View 7 Replies View Related

Automatically Sort Through Report By Date - How To Choose Multiple Dates Through Popup

Jul 26, 2013

I created a pop-up that appears when i open my report so that I can automatically sort through the report by date. However, the report will only allow me to choose one date and i need to be able to choose multiple dates. This pop-up is connected to a list box which has the multi select turned on. How can choose multiple dates through my pop-up?

View 1 Replies View Related

Rowsource Of Lookup Field Dependent On Field Value In Same Record In Subform

Jul 6, 2014

I want to create a different rowsource-query for a lookup field (field1) in each record in a subform. The rowsource changes dependent on the value in another field (field2) in the same record. How can this be done?

- I tried to change the rowsource-query in an eventmacro when the focus is set to field1, but this ofcourse changes the rowsource for all field1's and makes the allready selected values unvisible.
- I think I have to include the value of record 'field2' in the rowsource query, but i cannot find a way to include that value in the query.

Something like:

Lookup field1 in the subform contains this rowsource
- SELECT CUSTOMER.Id, CUSTOMER.AGE, CUSTOMER.NAME
FROM CUSTOMERS
WHERE (CUSTOMER.AGE= me![field2]);
me![field2] however does not function

View 5 Replies View Related

How To Sort The Field List

Aug 8, 2013

When I "Add Existing Fields" I'd like the list to be sorted alphabetically...how to do this?

View 4 Replies View Related

Unable To Sort Field

Aug 17, 2013

I created a table by importing data from an Excel spreadsheet. Now I have discovered that I am unable to filter the data, i.e. do an ascending and.or descending sort, in the first field of the table, which is a long text field. It is the only field that has text, all others are yes/no fields. Is there any way to fix this?

View 5 Replies View Related

How To Sort By A Calculated Field In A Query?

Jul 21, 2006

I have a query that draws from two tables, and the field in question looks like this:

X: [TableData]![FieldA]*[TableNumbers]![A]+[TableData]![FieldB]*[TableNumbers]![B]


It all works fine and dandy, but once I set it to sort by this field and run the query, it gives me the parameter prompt, asking me to enter the Parameter Value of FieldA and then for FieldB.

Is there a work-around for this within the query?

The only other solution I have in mind is making another table from this query, and then creating another query just for sorting said table, but that seems inefficient at best.

View 2 Replies View Related

Sort On Calculated Date Field

Mar 16, 2008

I have an expression in a query

Expire: IIf([payterm]="X","",DateAdd([payterm],1,[orderdate]))

However when I sort it it does not sort in correct manner

it's goes like

1/11/2007
1/15/2008
10/10/2006
10/16/2007
10/31/2007
10/5/2006

I have the field properties set to Short Date.

What do I need to do for this to sort right?

View 2 Replies View Related

Saving A Form's Sort Field

Sep 16, 2005

I have a form that has a bunch of project information and scrolling buttons at the bottom to browse by next/last.

Right now the form is sorted by the ID associated with the project, which kinda sucks because they were and are not put in alphabetically.

I discovered if you right click on a field and click "Sort Ascending" or the opposite it works fine but when I open the database it is right back to normal ID sort

I have checked the Data and Other tabs but can't find anything with regards to this as well as I have tried sorting the actual table by name and that changed nothing.

Any help would be greatly appreciated.

View 1 Replies View Related

Help Deleting Sort/grouping Field??

Sep 19, 2004

I am trying to remove a "sort and grouping" field from my report. I delete the field from the menu by using the "backspace" key on my key board. I am getting any error, invalid sort field. When I put something into the field, the error goes away. How do I delete a sorting field I do not want??

thanks for your help
newbie and learning

View 1 Replies View Related

ASC Or DESC Sort Based On Another Field

Aug 12, 2014

I have a query that lists items in locations in our warehouse. Each location is broken down by Aisle-Bay-Level-Position, for example 50-101-01B; or 51-106-02 with all the even Bays on one side and Odd bays on the other side of the aisle. I have the query set up so it separates odd and even so I can go all the way down one side of the aisle then I have to walk back to the beginning of the aisle to check the other side.

What I am trying to do is change the sort based on another field that I have called SORT with a value of AZ or ZA depending on if I need that section to be sorted ASC or DESC. So for example all even bays in aisle 51 need to be sorted DESC while all ODD bays would be ASC. The way our warehouse is laid out it is not always the odd or even side that needs to be sorted DESC, that's why I made the SORT field. The formula I used for the SORT field is as follows:

SORT: IIf(([Aisle]='50' And [OE]='ODD') Or ([Aisle]='51' And [OE]='ODD') Or ([Aisle]='53' And [OE]='ODD') Or ([Aisle]='52' And [OE]='EVEN'),'AZ','ZA')

Is there a way to make it sort the BAY in ASC or DESC based on the value in SORT?

As an example here is how I want the order to be:

50-101-01A
50-101-01B
50-103-02A
50-103-02B
51-101-01

[Code] .....

View 1 Replies View Related

How To Sort Number Field In A Form

Aug 1, 2012

I have a form where data can be added and it has different tabs. The 3rd tab has idVersion field and Comment field where users can add the version and comment, if needed. When they need to add another version, the blank fields will be added as next row, so on and so forth. The problem is users are adding a lot of versions but not sorted. So for example:

Row 1 of the form: idVersion field is "1" and comment has "Test 1".
Row 2 of the form: idVersion field is "8" and comment has "Test 8".

Row 3 of the form: idVersion field is "2" and comment has "Test 2".
Row 2 of the form: idVersion field is "5" and comment has "Test 5".

So how can I fix it where after they saved the version and comment, when they close the database and re-open it again, the data will show up as:

Row 1 of the form: idVersion field is "1" and comment has "Test 1".
Row 2 of the form: idVersion field is "2" and comment has "Test 2".
Row 3 of the form: idVersion field is "5" and comment has "Test 5".
Row 2 of the form: idVersion field is "8" and comment has "Test 8".

So even if they add a new version and comment (example version "3"), it will be automatically sorted when the database is reopen.

View 6 Replies View Related

Lookup 2 Field To Auto Fill Another Field?

Dec 30, 2012

Is it possible to look up 2 field to auto fill another field?

Field 1 is "Exposure" this autofill with "Probability" is user input.

I need to lookup Exposure and Probability and autofill a score in to "Risk Rating". This to stop incorrect data being inputted.

I have a table with all the results combination in it.

Would it be possible to use a Dlookup to look at Exposure and Probability to give me the score

I tried a Combox with autofill. But the power to be would like it done without user input.

View 11 Replies View Related

Sort On Total Field In CrossTab Query

Jan 11, 2007

Below is the sql code I have for a CrossTab Query. Total as GrandTotal
shows GrandTotal of all weekly columns. Is there anyway I can get the
Query Display to sort on the GrandTotal Column?

PARAMETERS [Forms]![Queries_ReportsFRM]![StartDateTxt] DateTime, [Forms]![Queries_ReportsFRM]![EndDateTxt] DateTime, [Forms]![Queries_ReportsFRM].[FaultCategory] Text ( 255 );
TRANSFORM Sum([Trends-1-3TON-WEEK].Totals) AS SumOfTotals1
SELECT [Trends-1-3TON-WEEK].SystemGroup, [Trends-1-3TON-WEEK].FaultCategory, Sum([Trends-1-3TON-WEEK].Totals) AS GrandTotal
FROM [Trends-1-3TON-WEEK]
GROUP BY [Trends-1-3TON-WEEK].SystemGroup, [Trends-1-3TON-WEEK].FaultCategory
ORDER BY Sum([Trends-1-3TON-WEEK].Totals)
PIVOT [Trends-1-3TON-WEEK].YearMonthWeek;

View 1 Replies View Related

Sort Alphanumeric Field - Code Problem

Dec 1, 2006

hi
i found this code here and it works IF the number comes first and is preceded by a letter
123AA

but it does not work if the letters come first
AA123

here's the code

Public Function GetString(WholeString As String) As String
Dim i As Integer
Dim Temp As String
Temp = CStr(WholeString)
For i = 1 To Len(WholeString)
If InStr(1, "0123456789.", Mid(Temp, i, 1)) = 0 Then
GetString = Mid(Temp, i)
Exit Function
End If
Next i
GetString = Temp
End Function

Public Function GetNumber(WholeString As String) As Double
Dim Temp As String
Dim i As Integer
Temp = CStr(WholeString)
For i = 1 To Len(Temp)
If InStr(1, "0123456789.", Mid(Temp, i, 1)) = 0 Then
GetNumber = Mid(Temp, 1, i - 1)
Exit Function
End If
Next i
GetNumber = Temp
End Function


the probelm is with this line but i'm not sure what it is

GetNumber = Mid(Temp, 1, i - 1)

(i also get runtime error 13) but my data is in the same format as the example i downloaded.

any ideas anyone?

thanks in advance and thanks to the person who created the code

View 1 Replies View Related

Forms :: Sort Putting One Record On Top Based On Yes / No Field

Mar 8, 2013

My table has 3 fields, Employee Number (text), Job Description (text) and Current (yes/no). The table keeps track of the Job Descriptions that an Employee has had along with his current Job Description (actually Title is more appropriate a word but client requested Description) So the table has records such as:

0001 - Floor Sweeping - no
0001 - Ceiling Cleaning - yes
0001 - Dumpster Turning - no

The yes signifies that that is the current Job Description for employee #0001 and the others with no are previous Job Descriptions that the employee #0001 has held.

Now - I created a form to add these records to the table and on that form I want a list box to show the records in the table for this employee but I want to sort it such that the current Job Description is listed first and the rest show up in alphabetical order following. I have the query to list all of the Description, but how can I get the current one to always appear on the top of the list?

View 14 Replies View Related

Queries :: Cannot Change Sort Order On Float Field

Apr 22, 2013

I have a query with a float/delta column which is the expression:

Code:
Float: [Date1] - [Date2]

When I try to change the order by in the column filter drop-down i get a data type mismatch in criteria expression error.

View 1 Replies View Related

Lookup Field

Jan 11, 2008

Hi,

my only other issue!!! i have a lookup field on a table and when i view it in datasheet, i can see the actual lookup value i need however i have tried the following options:
create a form from the table
added a combo box to an existing form and gone through the wizard

both options show the id number and NOT the value i need to show. what can i do to show my actual information?

many thanks,

NS

View 8 Replies View Related

Using The Lookup Field...

May 3, 2005

Let's say that I have two tables:

Table Numbers:

ID VALUE
-- ------
1 123
2 456
3 789

Table Letters

ID VALUE NUM_LOOKUP
-- ------ -------------
1 ABC 1
2 DEF 3

Now, I'd like to use the lookup feature so that NUM_LOOKUP is a combo that displays the data in VALUE based on the relationship between ID in the two tables.

So, when you open the Letters table, you see the above. If you click in the NUM_LOOKUP field, you get a box that displays "123" for the first record and "789" for the second record.

I'm very close -- Here's what I have:

I tried the following:
Display Control: Combo Box
Row Source Type: Table/Query
Row Source: SELECT [ID],[VALUE] FROM [Numbers] AS [NUM_LOOKUP];
Bound Column: 1
Column Count: 2

Problem: This selects ALL values of ID from [Numbers].

I tried adding the following to my row source:
WHERE [Letters].[NUM_LOOKUP]=[Numbers].[ID]

This just gives me the "enter parameter" dialog box for [NUM_LOOKUP] and [ID].

Any help?

Thanks!

View 2 Replies View Related

Lookup Field

Jul 31, 2006

Alright, I have a field called metrics that looks up the text in another table caled Metric Name. I want to delete the table that is being used to supply the values, but I still want a listbox with all those names. Also I want to be able to add names to that listbox. I am not sure how to do this.

View 3 Replies View Related

Help With Lookup Field

Dec 11, 2006

Hi all,

It is along since i have used access for anything and I am having problmes getting it to do what i want it to do.

I have 2 tables one which hold the data needed and the other is being used to hold a list of products with prices.

In my main talbe in which the data will be entered into I have a drop down so the product can be selected, once it is selcted i want the next field filled in automaticaly with the price. The look up looks at my products table which hold the price too. I tried with setting the look up based on a query but it get errors about using the same table

Anyone help me???

Thankyou for looking

View 11 Replies View Related

Lookup Field

Sep 25, 2006

I would like to create a lookup for a field - I want to display 2 columns, but store only one in the table.

Id City
1 Sheboygan
2 Sheboygan Falls
3 Plymouth


Show both fields in the lookup, but only store the Id in the table.

I can't seem to get the second column to display.

View 5 Replies View Related







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