Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Sorting Problem

Status
Not open for further replies.

fmaca

Technical User
Apr 24, 2002
16
CA
Good afternoon all.

I am using a combo box to enter data into an inventory table. Since I sometimes have to use the same part number twice with different descriptions, I have to use the ID column as the important data.

The inventory table has only the ID number and the quantity.

The problem I'm having is when I add a record to the table that I'm using as a reference for the combo box, the new number is always at the end of the list, not sorted numerically. It seems that the list is sorted by the ID number.


I have tried sorting the column (it's the first after the ID column) but that doesn't seem to work.

I tried using a query to sort the master part number table but for some reason once I do that the combo box will not recognize any of the inventory numbers.

Since the combo box has 5 or 6 columns in it, it would be nice to be able to specify which column I want sorted.

Can I do this, and can it be done without using VB?

Thanks.

Ethan
 

[red] CAUTION: If you have a lot data in your database already, I suggest you make a copy of it to play around with first in case something goes awry! [/red]

I am assuming that the inventory table has only the ID number and the quantity. If the ID number is the primary key (and it should be) then it can be text. You can set your field properties without programming to make sure it is sorted correctly.

Open the inventory table to design view. If you have not already done so, make the ID number the primary key. Under the general tab, make sure required is set to yes, allow zero length set to no, and indexed is set to yes (no duplicates). Save the table. When you open it again, your ID numbers will be sorted in ascending order.

You may get a warning from Access about doing this, but since you are using a COPY of your database, go ahead and try it.


Judge Hopkins

"...like hunting skunks underwater...."
John Steinbeck, The Grapes of Wrath
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top