Number Generation

C

Chrisfpe

Hi All,

I have a form in which I generate my own numbers instead of using autonumbers
and to do this I use the following code in the after update event:

If IsNull(gipdGRN) Then
gipdGRN = Nz(DMax("gidpGRN", "t07GoodsInPurchasingDetails") + 1, 1)
Else
Me!gipdGRN = Me!gipdGRN
End If

I have used this code thoughout my database with no problems but for some
reason it will not work on this form. I have even rebuilt the form from sratch
but the same thing keeps happening.

Any ideas?
TIA
Chris.
 
M

Mike Painter

Chrisfpe said:
Hi All,

I have a form in which I generate my own numbers instead of using autonumbers
and to do this I use the following code in the after update event:

If IsNull(gipdGRN) Then
gipdGRN = Nz(DMax("gidpGRN", "t07GoodsInPurchasingDetails") + 1, 1)
Else
Me!gipdGRN = Me!gipdGRN
End If

Me!gipdGRN = Me!gipdGRN is the probable problem

Me!gipdGRN = gipdGRN
 
C

Chrisfpe

Hi,

Sorry I forgot to say what happens.

Basically access throws up an error message and then just closes down.

I have taken out Me!gipdGRN = Me!gipdGRN but it still does the same thing.

TIA
Chris
 

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