I am trying to get the information in one feild to complile based on the information in 3 other feilds. Basicly, I have a SegmentID feild tat I want the data to be created from the County, Division, and section values.
So if County=FLES, Division=1, and Section=-001 Then SegmentID=FLES1-001
Here is the Code
Private Sub ScatSegment_AfterUpdate()
Dim cName As String
Dim dName As String
Dim sNumber As String
Dim sID As String
Forms!Segments!CountyID.SetFocus
cName = Forms!Segments!CountyID.Value
Forms!Segments!Division.SetFocus
dName = Forms!Segments!Division.Text
Forms!Segments!ScatSegment.SetFocus
sNumber = Forms!Segments!ScatSegment.Text
sID = cName & dName & sNumber
'This line is the offender as far as I can tell. When I palce a stop point here all of the values to the right of the = are correctly assigned but when I place the cursor over sID it says sID="". Why is it not combining the 3 values???
If Len(sID) = 8 Then
Forms!Segments!SegmentID.SetFocus
If Forms!Segments!SegmentID = "" Then
Forms!Segments!SegmentID = sID
End If
End If
End Sub
Thank you for any help you can provide
So if County=FLES, Division=1, and Section=-001 Then SegmentID=FLES1-001
Here is the Code
Private Sub ScatSegment_AfterUpdate()
Dim cName As String
Dim dName As String
Dim sNumber As String
Dim sID As String
Forms!Segments!CountyID.SetFocus
cName = Forms!Segments!CountyID.Value
Forms!Segments!Division.SetFocus
dName = Forms!Segments!Division.Text
Forms!Segments!ScatSegment.SetFocus
sNumber = Forms!Segments!ScatSegment.Text
sID = cName & dName & sNumber
'This line is the offender as far as I can tell. When I palce a stop point here all of the values to the right of the = are correctly assigned but when I place the cursor over sID it says sID="". Why is it not combining the 3 values???
If Len(sID) = 8 Then
Forms!Segments!SegmentID.SetFocus
If Forms!Segments!SegmentID = "" Then
Forms!Segments!SegmentID = sID
End If
End If
End Sub
Thank you for any help you can provide