Weird Sort Of Primary Key
May 24, 2007Why is my table being sorted like this?
Primary key
1
11
12
13
14
15
16
17
18
19
2
20
21
22
23
24
etc.
Why is my table being sorted like this?
Primary key
1
11
12
13
14
15
16
17
18
19
2
20
21
22
23
24
etc.
I have a query that fills a report that I have in an Access 2000 database. This report needs to be sorted by the following:
Code:ORDER BY tblPrimaryDept.PDName, tblSubDept.SDName, tblKeyStrategy.KSID, tblKeyInitiative.KIID, tblKeyDeliverable.KDID, tblSubDeliverable.TargetDate, tblQuarters.QID;
It's working fine, but .... (There's always a but)
tblKeyStrategy.KSID can be null, so therefore, it is sorted by null records, then ascending order tblKeyStrategy.KSID. What they client wants is it to be sorted by tblKeyStrategy.KSID first, then the null value ones.
ie:
So as it stands it currently does this:
Finance
Finance
Finance 1
Finance 2
Now they want it to do this:
Finance 1
Finance 2
Finance
Finance
Is there any way this can be done? I've been looking, but haven't seen anything regarding this.
Thanks for any assistance you can give me on this.
i made a report based on a query. when i run the query, my results are sorted by Job Time Ascending, like i want...
when i made my report i chose job id as the main group priority in the wizard..
now in my report it displays the jobs in ID ascending, rather than Job time ascending as my query says..
i dont want to re-do the report it took ages.. how can i fix this?
Hi all,
I have a form in Access 2K that properly displays city, state and zip codes. As I type in each letter of a city's name into the combo box, I get the first city in the sorted list displayed (autofills). That's fine when there is only one zip code for a city, but when I enter "chic" for chicago I still get the first chicago zip code in my table.
It sure would be nice if I could do a "sort within a sort" so that if there were two or more records with the same city name then that whole group would drop down so I could choose one of the other zip codes. If this is doable, kindly point me to an example as I need all the help I can get.
Thanks in advance for any responses.
D
I have a query that sorts players batting averages from highest to lowest. When I run the query just by itself it sorts it right however when I open the report based on that query it does not sort in descending order like I asked. What am I missing??
View 3 Replies View RelatedAccess 2003 -
I have many queries in a DB. they work fine, but *sometimes* some of my queries are wiped - when i try to run them they say "query must contain at least one cell" or something..
when i check the query then, its empty!
I have saved out the SQL code into a word doc because this has happened a few times now.. so i just copy and paste the query back in - but this is very inconvenient! what is going on?
I have 2 unbound boxes in the footer of my continuous form. Both total up separate sets of fields using DSum and do it correctly. I have used Conditional Formatting on Total1 to make the numbers turn bold and red whenever Total1 is greater than Total2.
Here comes the weird part. It will always work whenever Total1 is greater than Total2, but sometimes when Total2 is bigger, Total1 is still red, even after I attempt to modify it and it requeries, or I go to a different record and come back. Any thoughts??
Thanks
-Jason
I have a weird issue going on...I'm running a "Find Duplicates" query on one of my tables, I'm only checking for duplicate values in 2 fields and outputting a third. now this runs fine, unless I use the total's button to group them. When I group them that access instance stops responding. The reason I'm doing this is the third column can have duplicate values, for my purposes it doesn't matter, but I need to be able to see it.
I'm running this against 120k records.
Anyone help a poor man out?
Ok, a friend of my was on my laptop and he crashed the hardrive. I was able to get the database I have been working on off the computer but when I use my computer at work to try to open it, it opens but says
"Function is not available in expressions in tabel-level validation expresions"
on all the date-time functions. I can't save anything and my queries are not running because of this date/time thing. Anybody know what is going on?
I modified a form in an existing split database, by simply adding several fields. Now, I get various messages such as " not Access database "
or if it opens, the following message when I try to close it:
"Your last change may not have been changed because an internal buffer was locked by another user... "
Plus, when I do get out, I cannot delete the .ldb file which it says is open by Administrator. The thing is I ma only one to try this new database and I set no permisasions or... ?
Please, any ideas?
Russ
sorry,
there are too many requests and not enough information to easily create the required reports for my customers.
I want to copy a table/query with yes/no fields and paste into excel with the
boxes for the yes/no fields. . .
I can't remember or figure out how to do it. . .
I know it can be done as I have done it before, how, i can't recall. . .
thanks
sportsguy
:insert idiot emoticon:
Hi, I have a table with two fields: CustomerName and OrderNumber.
Some order numbers have dashes, for example:
123-4, 123-5, 123-6 etc.
I wrote a query to strip those dashes from these ordernumbers, but only for 3 specific customers: Mark, Mike and Jane.
This is the query:
SELECT CustomerName, OrderNumber,
IIf(InStr(1,[OrderNumber],"-")<>0 And InStr(1,[OrderNumber],"-B")=0,
IIf([CustomerName] Like '*mark*' Or [CustomerName] Like '*mike*' Or [CustomerName] Like '*jane*',
CStr(Mid([OrderNumber],1,InStr(1,[OrderNumber],"-")-1)),
CStr([OrderNumber])),
CStr([OrderNumber])) AS NewOrderNumber
FROM Test
GROUP BY CustomerName, OrderNumber,
IIf(InStr(1,[OrderNumber],"-")<>0 And InStr(1,[OrderNumber],"-B")=0,
IIf([CustomerName] Like '*mark*' Or [CustomerName] Like '*mike*' Or [CustomerName] Like '*jane*',
CStr(Mid([OrderNumber],1,InStr(1,[OrderNumber],"-")-1)),
CStr([OrderNumber])),
CStr([OrderNumber]));
This query works great when I run it from Access. However, if I run it from Visual Basic .NET, it does not strip any dashes for any customers. I am using the following connection string:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C: est.mdb
And the following query:
SELECT * FROM [Strip] ORDER BY NewOrderNumber
(Strip is the query name in Access)
Did anyone encounter a problem like this before?
Thank you,
Nader
hi all,
i have .adp projects.I am facing a problem for which i dont find any reason.whenver i open 2 .adp projects they hang up.I have to kill the msaccess.exe
It okay if i m running 1 project but i have to logout to open the second project.I can not run both at the same time.
Any help on this pls..
I am creating a switchboard to access a few data entry forms and to preview reports before printing. It seems that whenever I add a button to preview a certain form(the 4th button on the form, all others work fine), Access goes crazy. I get several errors, including:
"You have entered an expression that has an invalid reference to the propery MaxRecButton. "
and
"The Open Form action has been canceled"
Im also getting crashes to desktop and low memory errors.
Now I am getting "referenced memory" "memory could not be wrriten" errors? Is this an Access problem or a "need a computer upgrade" error?
Any clue why this might be happening for this form?
hi,
got a weird question.
Im working on a form atm (duh)
I have a form that exists in more tables.
Now you have 2 solutions: I can use a query and generate the form, or i can make various subforms.
what is the best option? or doesnt it make much diffrence?
I am creating a database. There are two main tables - Table 1 is created via a Make Table query, which pulls from an Oracle db, which is the db for our department's customer service system. Table 2 is populated via a form. Table 1 has personal customer information and Table 2 has order information. The two tables share a Customer ID. Table 2 contains data that was imported from an Excel sheet (what the users had been using up until this db was created). For this example, let's say each customer will only ever have one order so there will be a record to record match. Also, since Table 1 has to be manually refreshed using real-time data, it may lag behind or be ahead of Table 2.
Here's my problem:
I want the user to see the customer's name when he/she types in the Customer ID. I got the DLookup to work for NEW records - that is, for records that exist in Table 1 but have not yet been entered into Table 2 - but it will NOT work for the 300+ records that I imported from Excel. For those records, the Name textbox remains blank or if I type in the Customer ID, gives me an error about entering duplicate values.
Furthermore, if Table 1 is lagging behind Table 2, I want the user to just go ahead and enter all the order information and when he/she goes back to update the order at a later date (after Table 1 has been refreshed), the name to just pop up.
Can anyone help or offer any thoughts?
Thanks.
Ok, a friend of my was on my laptop and he crashed the hardrive. I was able to get the database I have been working on off the computer but when I use my computer at work to try to open it, it opens but says
"Function is not available in expressions in tabel-level validation expresions"
on all the date-time functions. I can't save anything and my queries are not running because of this date/time thing. Anybody know what is going on?
Hi,
I have this querry but when I execute on a button click it dosen't give me any error....but no data is saved in the table, why????
strSQL = " UPDATE DISTINCTROW projet set id='" & txt_id.Value & "',code_NOP='" & txt_code_NOP.Value & "',client='" & txt_client.Value & "',libelle_projet='" & txt_libelle_projet.Value & "',id_clarity='" & txt_id_clarity & "',technologie_projet='" & txt_technologie_projet.Value & "',em='" & txt_em.Value & "',date_debut=#" & txt_date_debut.Value & "#,date_fin=#" & txt_date_fin.Value & "#,site_mandataire='" & txt_site_mandataire.Value & "',charge_totale=" & txt_charge_totale & ",ca_total_vendu=" & txt_ca_total_vendu.Value & " WHERE id='" & Form_projet.id.Value & "';"
This outputs smth
SELECT Proj_Name & '-' & Proj_ID as Emp_Pr from Emp_Prj where trim(Proj_Name) like trim('Dot')
------
But not this...why ??? I am using ms access
SELECT Proj_Name & '-' & Proj_ID as Emp_Pr from Emp_Prj where trim(Proj_Name) like trim('%Dot%')
Okay guys. This one may not be able to get answered. I made a report in Landscape view. However, when you look at it on a different computer, it shows portrait. I know what your thinking, but I checked the page setup and everything and it says it's in landscape view. Even when I print it, it prints in landscape. Does anyone know why this one computer refuses to show landscape? Has anyone ever seen this problem before? I don't even know where to start to fix it. It's just weird!
View 2 Replies View Relatedhave a table call 'ClinicTimeTable' there is a column call 'ClinicDate', another column called 'DrID', different row could have same 'ClinicDate' and 'DrID', so I wanna to count how many Drs in a particular day, I have following code, but it acts so werid, it onlys work for some dates! say if I put 02/02/2006 then I can get the number of DrID by observing 'count', however, if I put 01/02/2006 like below, count is 0! but there is some records with 02/02/2006 (I open the table directly in Access), how can this happening? how can it only partly works? it will make more sense if it don't work at all.
Dataset ds = new Dataset();
query = "SELECT DISTINCT DrID FROM ClinicTimeTable WHERE ClinicDate = #01/02/2006#" ;
OleDbDataAdapter myAdapter = new OleDbDataAdapter( query, oleDbConnection1 );
myAdapter.Fill ( ds );
int count = dds.Tables[0].Rows.Count;
any helps will be so appreciated! I am going mad at this problem!
by the way, i just tested that if any day in Jan 2006 is fine, say if i search 23/02/2006 or 22/02/2006 is fine... can't imagine why...
Hello,
I have simple invoice database, tyhe old one I made works fine, trying to make a newone always simple but now Access is not helping me for some reason,,,, Can you look at this? I create an invoice form using wizzard i join invoices and invoices details to it and from there I create my Invoive form that has the invoice info and the details.... I change some stuff for looks and easyness... Mostly change text boxes to combo boxes... I did this in office 2003 and had the same results than in office 2002, Why dont know... Once I create the invoice from and change the text boxes combos and ofcourse set everything else, once I pick a product from the detail form I get the product but I dont get its price. Now on my other older database made excatly the same way it works!!!! WHY IIIIIIII DONT KNOW!!! please help me:(
I have attached both db so you can look at them!!!
Thanks
I have designed a VB2005 executable to pick up data on a small network, from an Access2000 database. While designing [on what would be the "server" machine] I encountered no problems. When I moved the VB2005 EXE to another machine on the network, I encountered this problem, fully reproducible and isolated as follows...:
The problem began with being unable to connect [from machine 2] back to the Access2000 database on machine 1.
I can connect to any other Access2000 Database, there. I can also run on machine 2, any MDB file EXCEPT the one causing problems. I could not COPY the MDB file from machine 1 to machine 2, receiving again, a notice that the file was either in use [NOT] or for which permissions were granted.
In an effort to determine what was going on, and isolate the cause, I made a copy of the MDB, and oddly COULD copy it across the network. BUT, if I started up that same copied-MDB into Access2000 on Machine 1 [just ONCE], I can no longer copy it across the network. In further efforts to isolate the problem, I attempted to determine if any executing/startup code in the MDB was causing this glitch, and to my suprise, I discovered that even if I had NO CODE executing [setting startup form to <none>] , this weird behavior would continue.
To me, this indicates a weird unknown lock being set by the program [Access2000], on a run-once occurrence. Again, I can't even copy [a "runned-onced"] MDB file; and this behavior ONLY occurs for this single file.
I can repeatedly make copies of the MDB file, and so long as any copy is not run in Access2000, I can copy the MDB across the network.
My dilemma is that this MDB file is full of tables and code, associated with full numbers of forms, and I can't access the data across a network, and I have no idea why. Anyone have suggestions?
Thanks
[
Access2000 runs on a WinXP machine [machine 1].
The relevant folders are open and shared across the network.
]
I get this error when I send the mdb file to another computer and open the mdb file?
Your database or project contains a missing or broken reference to the file 'IAIExplore.dll' version 1.0.
I checked my computer and that dll file is in my InterActual dvd player bin folder, and what that has to do with my mdb file I have no clue?
Any help would be greatly appreciated.
I have a software package that uses a DBF file. I am linking to that file in Access 2002. Most of the fields are fine- however- at some point some of the field sizes are cut short. A text field that should have a size of 255 comes in as being a size of 44. This causes weird results in my data- shifting the data that's cut off into other fields and whatnot.
I have tried importing instead of linking- but get the same results. Same w/ copy/paste. The software package runs fine- and doesn't display these odd results. Obviously I can't go in and modify the software package (and I'm not sure that's where the problem is to begin with).
If I EXPORT out of the software package- I have to create an HTML file (I know- LAME!), then import it on into Excel- where, I can put in a dummy record row so that Access declares the right type of field to use for the tables upon importing (PAIN IN THE @$$!)- but- it doesn't cut the fields off. So, I know the problem is in Access linking to this DBF file, and not the DBF file itself.
Does anyone have any solutions here?
Thanks
Hello..
I am having something weird happen to one of my databases. I split the database. That worked fine. But now anytime someone opens it up.. a database1.mdb file is created in the spot I split my database in. If it is opened again.. database2.mdb file is created and so on. Has this happened to anyone?
When the shut down the database the above files remain in the directory.
Thanks