sequential numbering?

G

Guest

I have the following code in a form attached to event of a field called
Anything

Private Sub Anything_BeforeUpdate(Cancel As Integer)
Me![SID] = (Nz(DMax("[Sid]", "Steps", "[pID]=" & [PID]), 0) + 1)
End Sub

I have put it in to get sequential numbering and it works partly
Problems are that if I go into the form field Antything again for that
record and add or delete or make any changes it will increment the number
again. I dont want it to do this, once the number is generated it should be
fixed for that record. What do I need , some sort of If statement?

At some stage also I may need to insert or delete a record in which case
this no will be out of sync - but I will leave that to another post?
 
D

Douglas J Steele

Already answered in another newsgroup to which you posted the same question.

If you feel you need to post to more than one group (HINT: it's seldom
necessary), please have the courtesy to cross-post (send the one message to
all groups at once), rather than multi-post (send individual messages to
each group). In this way, all responses to your post will be available
together, regardless of what group the responder was in, and the rest of us
won't have to read your post multiple times. (It also uses fewer server
resources)

If you're using Microsoft's web interface to post, please note that you can
type the names of the various groups into the Newsgroup box. Separate each
newsgroup name with a semicolon.

Note that it's generally consider to be A Bad Thing to cross-post to more
than about 2 or 3 newsgroups.
 

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