Very Urgent (1 Viewer)

geraldcor

Registered User.
Local time
Today, 21:18
Joined
Jan 26, 2004
Messages
145
Hello, I am hoping for the powers of the forum to help me. I need this fixed fast too, our company is at a standstill for a while. I have a form where we check in samples that are delivered to us to be tested. This form is based on a table. the table has many many records as well as fields. The records are not displaying in order. i.e. when you click on the go to next record button, it displays 00-54903 instead of 93-23456. I look at the table and it is in order. The other day it got out of order somehow and I just right clicked and sorted and that worked. But this morning the samples do not show up in the right order and we can't check in any new samples because the numbering scheme is all wrong. Any help will be so appreciated. Let me know if you need more info.
Greg
 

pat_nospam

Registered User.
Local time
Today, 21:18
Joined
Oct 14, 2003
Messages
151
Hi - Sounds like you need to make your control source for the form into a query and sort the query Ascending or Descending on whatever field you wish.

That should clear things up. That way, everytime the data is pulled, it's sorted.
 

geraldcor

Registered User.
Local time
Today, 21:18
Joined
Jan 26, 2004
Messages
145
Why did this just happen? I can sort the records by short sample id (34567) in the table and that has worked flawlessly up until now. Making a query might work. Thank you. Any other suggestions?
Greg
 

geraldcor

Registered User.
Local time
Today, 21:18
Joined
Jan 26, 2004
Messages
145
So I made a query. It Works. Hopefully that will solve some problems. Thanks for the speedy reply.
Still, if anyone has any insight into why my table would be ordered correctly but displayed out of order on the form, feel free to enlighten me.
Greg
 

pat_nospam

Registered User.
Local time
Today, 21:18
Joined
Oct 14, 2003
Messages
151
I think it happens, because a table is sorted only once (or when you go in and sort the table again manually). Therefore, if anything pulls it out of whack, it won't resort without manipulation.

Basing a form on a query as it's control source is good practice, as it speeds up your application and releases a lot of processor overhead. Not to mention, you can put a sort rule into the query, to ensure that your data is always sorted :)

Hope this helps,

Pat
 

geraldcor

Registered User.
Local time
Today, 21:18
Joined
Jan 26, 2004
Messages
145
This didn't completely solve my problem. When I click the add a new sample button it adds the new sample after the last '99 sample id. It calls it 04-48234, which should be 99-48234 or 00-48234 not 04-73675. Still a major problem.
Greg
 

geraldcor

Registered User.
Local time
Today, 21:18
Joined
Jan 26, 2004
Messages
145
Making a query based on my table is not the solution for this problem. I made a new form with just the SampleID field. As I scroll through the numbers they are out of order. I look at my table and it is definitely ordered correctly, but somehow in the displaying of records it orders them by a different means. I order them in the table using the ShortSampleID field (Minus the 04-). It is like on the form it orders by the SampleID field. Using a query made the records show up in order but I still couldn't add a new number correctyly becasue the table was still unordering itself somewhere in the form. This is amazingly mind boggling.
Greg
 

Ukraine82

Registered User.
Local time
Today, 13:18
Joined
Jun 14, 2004
Messages
346
Try pasting this code below by making a command button in form for sorting.

FieldName.SetFocus
DoCmd.RunCommand acCmdSortAscending


hth,

Michael
 

Users who are viewing this thread

Top Bottom