Creating Successive Numbers (Order Numbers) 
Author Message
 Creating Successive Numbers (Order Numbers)

Hi Everyone,

I need to put a new order number each time I create a new order document. I
need them to be successive numbers, from 1 Word session to the next. Is it
possible?
Perhaps an Access or Excel solution?

Any help would be greatly appreciated.

Thank you,

Paul



Thu, 20 Feb 2003 00:50:52 GMT  
 Creating Successive Numbers (Order Numbers)


Quote:
> Hi Everyone,

> I need to put a new order number each time I create a new order
document. I
> need them to be successive numbers, from 1 Word session to the next.
Is it
> possible?
> Perhaps an Access or Excel solution?

> Any help would be greatly appreciated.

> Thank you,

> Paul

Hi Paul,

You could solve this by using an AutoNew macro, that reads in a value
from a file, increments the value, writes it back to the file and puts
it in the new document you just made.

A macro with the name Sub AutoNew will run every time you create a new
document.
Similarly there are AutoOpen, AutoClose and AutoExit macros that do
something when opening a file, closing it, or stopping Word.

Hope this helps

Richard (NL)

Sent via Deja.com http://www.deja.com/
Before you buy.



Thu, 20 Feb 2003 02:40:11 GMT  
 Creating Successive Numbers (Order Numbers)
Hi Doug and many thanks for your suggestion. I will use it to save my quote
memos. I ended up writing the following procedure over the weekend.

Private Sub AutoNew()
    On Error Resume Next

    Application.ScreenUpdating = False
    Documents.Open "C:\Windows\Application
Data\Microsoft\Templates\PaulSNewPO.doc"

    ActiveDocument.Tables(1).Columns(1).Cells(1).Select
    PaulSNewPO = Selection
    PaulSNewPO = Left(PaulSNewPO, Len(PaulSNewPO) - 2)

    NewPO = PaulSNewPO + 1
    With ActiveDocument
    .Tables(1).Columns(1).Cells(1).Range.Text = NewPO
    .Save
    .Close
    End With

End Sub

Again, many thanks for the help.

Paul



Sat, 22 Feb 2003 21:07:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. populating order number field affects unrelated orders!

2. Sorting numbers in Descending Order using ORDER BY

3. Sorting numbers in Descending Order using ORDER BY

4. Relation of numbers with alphabetic order.

5. line numbers in order detail table

6. Insert Number Order

7. Jumble into Random Order the Numbers in a Column

8. Ordering A Set of Numbers

9. Order Number Entry??

10. DataReport - How do I select order number

11. Sequential Order Numbers

12. I want to round a number to the nearest order of 10

 

 
Powered by phpBB® Forum Software