The error i am getting is "case without select case." What have i done wrong?
Select Case x
Case "0":
If Len(Trim$(Trip1(0).Text)) > 0 Then
Data3.Recordset("origin" = Trip1(0).Text
End If
If Len(Trim$(Trip1(1).Text)) > 0 Then
Data3.Recordset("stop1" = Trip1(1).Text
End If
If Len(Trim$(Trip1(2).Text)) > 0 Then
Data3.Recordset("stop2" = Trip1(2).Text
End If
If Len(Trim$(Trip1(3).Text)) > 0 Then
Data3.Recordset("stop3" = Trip1(3).Text
End If
If Len(Trim$(Trip1(4).Text)) > 0 Then
Data3.Recordset("stop4" = Trip1(4).Text
End If
Case (1):
If Len(Trim$(Trip2(0).Text)) > 0 Then
Data3.Recordset("origin" = Trip2(0).Text
End If
If Len(Trim$(Trip2(1).Text)) > 0 Then
Data3.Recordset("stop1" = Trip2(1).Text
End If
If Len(Trim$(Trip2(2).Text)) > 0 Then
Data3.Recordset("stop2" = Trip2(2).Text
End If
If Len(Trim$(Trip2(3).Text)) > 0 Then
Data3.Recordset("stop3" = Trip2(3).Text
End If
If Len(Trim$(Trip2(4).Text)) > 0 Then
Data3.Recordset("stop4" = Trip2(4).Text
End If
Case (2):
If Len(Trim$(Trip3(0).Text)) > 0 Then
Data3.Recordset("origin" = Trip3(0).Text
End If
If Len(Trim$(Trip3(1).Text)) > 0 Then
Data3.Recordset("stop1" = Trip3(1).Text
End If
If Len(Trim$(Trip3(2).Text)) > 0 Then
Data3.Recordset("stop2" = Trip3(2).Text
End If
If Len(Trim$(Trip3(3).Text)) > 0 Then
Data3.Recordset("stop3" = Trip3(3).Text
End If
If Len(Trim$(Trip3(4).Text)) > 0 Then
Data3.Recordset("stop4" = Trip3(4).Text
End Select
Data3.Recordset.Update
Next x
Select Case x
Case "0":
If Len(Trim$(Trip1(0).Text)) > 0 Then
Data3.Recordset("origin" = Trip1(0).Text
End If
If Len(Trim$(Trip1(1).Text)) > 0 Then
Data3.Recordset("stop1" = Trip1(1).Text
End If
If Len(Trim$(Trip1(2).Text)) > 0 Then
Data3.Recordset("stop2" = Trip1(2).Text
End If
If Len(Trim$(Trip1(3).Text)) > 0 Then
Data3.Recordset("stop3" = Trip1(3).Text
End If
If Len(Trim$(Trip1(4).Text)) > 0 Then
Data3.Recordset("stop4" = Trip1(4).Text
End If
Case (1):
If Len(Trim$(Trip2(0).Text)) > 0 Then
Data3.Recordset("origin" = Trip2(0).Text
End If
If Len(Trim$(Trip2(1).Text)) > 0 Then
Data3.Recordset("stop1" = Trip2(1).Text
End If
If Len(Trim$(Trip2(2).Text)) > 0 Then
Data3.Recordset("stop2" = Trip2(2).Text
End If
If Len(Trim$(Trip2(3).Text)) > 0 Then
Data3.Recordset("stop3" = Trip2(3).Text
End If
If Len(Trim$(Trip2(4).Text)) > 0 Then
Data3.Recordset("stop4" = Trip2(4).Text
End If
Case (2):
If Len(Trim$(Trip3(0).Text)) > 0 Then
Data3.Recordset("origin" = Trip3(0).Text
End If
If Len(Trim$(Trip3(1).Text)) > 0 Then
Data3.Recordset("stop1" = Trip3(1).Text
End If
If Len(Trim$(Trip3(2).Text)) > 0 Then
Data3.Recordset("stop2" = Trip3(2).Text
End If
If Len(Trim$(Trip3(3).Text)) > 0 Then
Data3.Recordset("stop3" = Trip3(3).Text
End If
If Len(Trim$(Trip3(4).Text)) > 0 Then
Data3.Recordset("stop4" = Trip3(4).Text
End Select
Data3.Recordset.Update
Next x