VBA doesn't use line numbers. I haven't see Basic with line numbers since
programming my Apple II or the XT.
Try this:
Private Sub Form_AfterUpdate()
If Not IsNumeric([pos]) Then
[Pos2] = "1000"
Else
[Pos2] = [pos]
End If
End Sub
HTH

Signature
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
> Can anyone tell me what might be going on with this simple code. I have this
> code on a command button, it does what I want it to do. When I close the
[quoted text clipped - 9 lines]
> 50 [Pos2] = "1000"
> 70 End Sub
Thanks, that works the same. My problem is still the same. When I close the
form, it tells me that it can't same the record at this time. If I say ok,
the form close and the records is saved in the table. I think it is a timing
issue. When I remove [Pos2] = [pos] from the code the records saves without
being prompted.
Any ideas what might be happening here?
Thanks.
> VBA doesn't use line numbers. I haven't see Basic with line numbers since
> programming my Apple II or the XT.
[quoted text clipped - 24 lines]
> > 50 [Pos2] = "1000"
> > 70 End Sub
Steve Sanford - 15 Apr 2008 20:14 GMT
all I did was edit the code you provided. Not being able to see your MDB, I
have no idea if it is a timing issue. I know nothing about your form,
controls or tables.
Basically, your code says "If the value in is not a number put the text
"1000" in [Pos2] Else put [pos] in [Pos2].
Is the data type of [Pos2] String or Number?

Signature
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
> Thanks, that works the same. My problem is still the same. When I close the
> form, it tells me that it can't same the record at this time. If I say ok,
[quoted text clipped - 34 lines]
> > > 50 [Pos2] = "1000"
> > > 70 End Sub