Form sorts items

GagaZ

New member
Local time
Today, 12:53
Joined
Dec 5, 2007
Messages
9
Hi,
I have following problem:
I'm in Invoice nr 1, and enter following item products:
Lettuce
Apple
Oil
Cucumber
If I go out of the invoice and come back item are sorted ascending:
Apple
Cucumber
Lettuce
Oil

I want my Items to stay in order as I have entered them in first place.
Please can you help me how to do that.
Thanks
GagaZ
 
Is your subform bounded to a table? if so, is the table ordered by the item name?
If this is the case check in the table's Order by property and erase whatever text is there. If this doesnt work create a autonumber field, then create a query including the fields in the table and ordered by that autonumber field and bound it to your subform.
 
Grouping of same Items in Form

Hi,
Thanks for help I removed Order By property and now its working for most of the form. There is still problem that same items get grouped. Example


I have table Invoice, Invoice details, Products.
Invoice details table is in 1 to many relationship to Invoice and Products, where primary key is only in Invoice and Products (table Invoice field InvoiceId (pk) is in relationship with table InvoiceDetails field InvoiceId (not pk), and same for products table filed ProductID (pk) s in relationship with table InvoiceDetails field ProductId (not pk), i know relationship is not normalised like this but this is the only way that I can enter multiple times same Product item (Apples) in Invoice nr1.
I'm entering following:
I have form Invoice with subform Products
Invoice Nr 1

Products:
1.Oil
2Apples
3.Cucumber
4.Oil

When I go to invoice nr 2 and come back to invoice nr1 my Product
form have grouped same items.

Looks like:
1.Oil
2.Oil
3.Apples
4 Cucumbers
Is there way to dtop grouping of same items.
Thanks
GagaZ
 
each invoice detail line should have its own ID, which normally can be provided by an autonumber or even better a DMax+1 function. Then you can sort by that field.
 
Grouping

Hi Bob,
I have registered to your website and have send you zipped file, could not do through Access-programers as file was to big. When you have time could you have look and tell me where I'm doing wrong.
Thanks,
GagaZ
 
Take your table invoice details (tblDetails) and add an extra field

fldDetailsID - AutoNumber

Create a query (qryDetails)

Select *
From tblDetails
Order By fldDetailsID

Then Bound your form to qryDetails

this will work for the invoices you will create from now on
 
You already have everything in place, but all you need to do is open the query underlying the Orders Subform and add Ascending to the sort on OrderDetailsID. The query already has the sort on OrderID but you need to add it for the details field as well.
 
Form Sorting Items

Hi,
Thanks all of for your help its working now. In regard of creating each time new numbering in product subform that resets (and starts from 1) with each new invoice I will try first to code it by my self and if in trouble I will make new thread.
Thank for help again,
GagaZ
 

Users who are viewing this thread

Back
Top Bottom