C
carriey
Hi, this is my first time trying to write code like this (thanks to the
newsgroup for help!) and I haven't quite got it. When I click Debug, I get
an error "Variable not defined", and it goes to DLS.
I tried Dim Survey_System = String but that gives me error messages too.
Can someone please tell me how to define my variable? Here's the code:
Private Sub Survey_System_AfterUpdate()
If Survey_System = DLS Then
Me!LE = Left(Me!UWI, 3)
Me!LSD = Mid(Me!UWI, 4, 2)
Me!SEC = Mid(Me!UWI, 6, 2)
Me!TWP = Mid(Me!UWI, 8, 3)
Me!RGE = Mid(Me!UWI, 11, 2)
Me!MER = Mid(Me!UWI, 13, 2)
ElseIf Survey_System = NTS Then
Me!NTS_QUnit = Mid(Me!UWI, 4, 1)
Me!NTS_Except = Mid(Me!UWI, 5, 1)
Me!NTS_Unit = Mid(Me!UWI, 6, 3)
Me!NTS_4Block = Mid(Me!UWI, 7, 1)
Me!NTS_Map = Mid(Me!UWI, 10, 3)
Me!NTS_6Block = Mid(Me!UWI, 13, 1)
Me!NTS_7Block = Mid(Me!UWI, 14, 2)
End If
End Sub
Thanks!
newsgroup for help!) and I haven't quite got it. When I click Debug, I get
an error "Variable not defined", and it goes to DLS.
I tried Dim Survey_System = String but that gives me error messages too.
Can someone please tell me how to define my variable? Here's the code:
Private Sub Survey_System_AfterUpdate()
If Survey_System = DLS Then
Me!LE = Left(Me!UWI, 3)
Me!LSD = Mid(Me!UWI, 4, 2)
Me!SEC = Mid(Me!UWI, 6, 2)
Me!TWP = Mid(Me!UWI, 8, 3)
Me!RGE = Mid(Me!UWI, 11, 2)
Me!MER = Mid(Me!UWI, 13, 2)
ElseIf Survey_System = NTS Then
Me!NTS_QUnit = Mid(Me!UWI, 4, 1)
Me!NTS_Except = Mid(Me!UWI, 5, 1)
Me!NTS_Unit = Mid(Me!UWI, 6, 3)
Me!NTS_4Block = Mid(Me!UWI, 7, 1)
Me!NTS_Map = Mid(Me!UWI, 10, 3)
Me!NTS_6Block = Mid(Me!UWI, 13, 1)
Me!NTS_7Block = Mid(Me!UWI, 14, 2)
End If
End Sub
Thanks!