M
Mike
Hello all, I have the following code in the beginning of an event.
Private Sub LocationID_Exit(Cancel As Integer)
Dim Cury As Integer
Dim Curx As Integer
Dim stDocName As String
On Error GoTo Err_LocationID_Exit
Curx = Nz(DMax("[StopNumber]", "LoadStops", "[id]=" & Forms!loads![ID]), 0)
It errors on an if then statement involving the value of Curx. When I type
"? Curx" in the immediate window I get a blank line. When I type "?
Nz(DMax("[StopNumber]", "LoadStops", "[id]=" & Forms!loads![ID]), 0)" there
I get 0 which is correct for the data in the form.
Why does it not correctly assign the value? I am a newbie at code so please
be gentle.
Mike
Private Sub LocationID_Exit(Cancel As Integer)
Dim Cury As Integer
Dim Curx As Integer
Dim stDocName As String
On Error GoTo Err_LocationID_Exit
Curx = Nz(DMax("[StopNumber]", "LoadStops", "[id]=" & Forms!loads![ID]), 0)
It errors on an if then statement involving the value of Curx. When I type
"? Curx" in the immediate window I get a blank line. When I type "?
Nz(DMax("[StopNumber]", "LoadStops", "[id]=" & Forms!loads![ID]), 0)" there
I get 0 which is correct for the data in the form.
Why does it not correctly assign the value? I am a newbie at code so please
be gentle.
Mike