Generating a Sort Order Button

M

Melanie H.

Hello everyone! I need some help with a couple of pieces of code I will be
using for an Estimate/Proposal database. This form will feed a table storing:

ID, Estimate No, Line, Quantity, Product, Price

The industry that my employer works in often must supply proposals via
divisions. So, that means that our proposal must show products grouped into
sections. This is fine on original proposals, but on our revisions, we may
have to go back and insert lines for additional products the customer may
request (beyond original scope), or do additional breakdowns. In order to
achieve my goal, I will need Arrow Up and Arrow Down buttons attached to
macros which will change the sort order. I have seen other databases with
this functionality, but I have not clue #1 what the code would look like.

This is a two part question.

#1 Need Help Establishing the Code to Automatically Generate Sort Order
Numbers

This "Products Page" will be a subform, tied back the main form via the
Estimate No. ID, Estimate No and Line will be hidden fields, visibility
turned off. So, I need the code that would automatically set the first line
for that estimate at "1" and advance the number by one each time a product is
listed or a blank line is inserted.
************************************************************

Example:

Line Qty Product
Amt
1 5 3'0" x 7'0" Hollow Metal Detention Doors $0,000.00
2 8 3'6" x 7'0" Hollow Metal Detention Doors $0,000.00
3 (Blank)
4 5 3'0" x 7'0" Hollow Metal Detention Frames $0,000.00
5 8 3'6" x 7'0" Hollow Metal Detention Frames $0,000.00

************************************************************
This code must also be aware of the Estimate No. I want the number to reset
itself to zero when a new Estimate No is encountered or started, but if I go
back and add in lines on previous estimates I want it to detect what the last
line number was and add 1 number to that.

#2 I will also need help with the code linking the Two Command (Arrow
Buttons) to an event procedure.

When I mash the up button it re-numbers the items from the record preceding
down and re-sorts the column to give the appearance so that the record has
moved up one line. Of course with the down button it would re-number the
items from the current line down and re-sort.

***********************************************************
Woops! Now there is a revision and the customer wants another size door
quoted.

Line Qty Product
Amt
3 2 3'10" x 7'0" Hollow Metal Detention Doors $0,000.00

Line 3 must become line 4, line 4 must become line 5 and so on and so forth.

***********************************************************

Can anyone help me? I know this is a lot, but any help is much appreciated.

Melanie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top