Number Generation

  • Thread starter Thread starter Chrisfpe
  • Start date Start date
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.
 
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
 
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
 
Back
Top