DEADLINE! Please help!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • KitKat

    #1

    DEADLINE! Please help!

    I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam 7,
    and Cam 8. Well it does that but it also needs to change the file name to
    the same folder where the file is being grabbed, BUT it doesn't. I have
    tried and tried.....pleas e help

    example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
    7\Cam7-20060224170000-01.jpg

    Cam7 but all I keep getting is Cam1, as the beginning of the jpg
    name,...:( HELP!



    Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
    DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
    Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text

    For i As Integer = 1 To 8

    Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" & i)

    If Not pcb Is Nothing Then

    pcb.Image = Image.FromFile( String.Format(f older, i))

    'Else

    ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review Files\2-24\Cam
    7\Cam7-20060224170000-01.jpg")

    End If

    Next i


  • Mike Levine

    #2
    Re: DEADLINE! Please help!

    What does happen...
    I do not see the Format specifier to change the file name...

    Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
    DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
    Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text

    --
    mike

    "KitKat" <kitkat@nospam. com> wrote in message
    news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...[color=blue]
    >I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam
    >7, and Cam 8. Well it does that but it also needs to change the file name
    >to the same folder where the file is being grabbed, BUT it doesn't. I have
    >tried and tried.....pleas e help
    >
    > example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
    > 7\Cam7-20060224170000-01.jpg
    >
    > Cam7 but all I keep getting is Cam1, as the beginning of the jpg
    > name,...:( HELP!
    >
    >
    >
    > Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
    > DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
    > Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
    >
    > For i As Integer = 1 To 8
    >
    > Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" & i)
    >
    > If Not pcb Is Nothing Then
    >
    > pcb.Image = Image.FromFile( String.Format(f older, i))
    >
    > 'Else
    >
    > ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
    > Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
    >
    > End If
    >
    > Next i
    >
    >[/color]


    Comment

    • KitKat

      #3
      Re: DEADLINE! Please help!

      Thanks Mike for the help!

      That snippet changes the file name to: C:\Projects\Dar ryl\Queue Review
      Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg

      :(


      "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
      news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...[color=blue]
      > What does happen...
      > I do not see the Format specifier to change the file name...
      >
      > Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
      > DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
      > Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
      >
      > --
      > mike
      >
      > "KitKat" <kitkat@nospam. com> wrote in message
      > news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...[color=green]
      >>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam
      >>7, and Cam 8. Well it does that but it also needs to change the file name
      >>to the same folder where the file is being grabbed, BUT it doesn't. I have
      >>tried and tried.....pleas e help
      >>
      >> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
      >> 7\Cam7-20060224170000-01.jpg
      >>
      >> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
      >> name,...:( HELP!
      >>
      >>
      >>
      >> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
      >> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
      >> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
      >>
      >> For i As Integer = 1 To 8
      >>
      >> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" & i)
      >>
      >> If Not pcb Is Nothing Then
      >>
      >> pcb.Image = Image.FromFile( String.Format(f older, i))
      >>
      >> 'Else
      >>
      >> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
      >> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
      >>
      >> End If
      >>
      >> Next i
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Mike Levine

        #4
        Re: DEADLINE! Please help!

        So where does the "Cam" prefix in the file name come from.
        The code you posted doesn't show it.

        "cmbTime.Te xt" what is this cmbTime object, it sounds like that's where the
        bug is.


        "KitKat" <kitkat@nospam. com> wrote in message
        news:%23DDDhevT GHA.1868@TK2MSF TNGP09.phx.gbl. ..[color=blue]
        > Thanks Mike for the help!
        >
        > That snippet changes the file name to: C:\Projects\Dar ryl\Queue Review
        > Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg
        >
        > :(
        >
        >
        > "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
        > news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...[color=green]
        >> What does happen...
        >> I do not see the Format specifier to change the file name...
        >>
        >> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
        >> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
        >> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
        >>
        >> --
        >> mike
        >>
        >> "KitKat" <kitkat@nospam. com> wrote in message
        >> news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...[color=darkred]
        >>>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam
        >>>7, and Cam 8. Well it does that but it also needs to change the file name
        >>>to the same folder where the file is being grabbed, BUT it doesn't. I
        >>>have tried and tried.....pleas e help
        >>>
        >>> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
        >>> 7\Cam7-20060224170000-01.jpg
        >>>
        >>> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
        >>> name,...:( HELP!
        >>>
        >>>
        >>>
        >>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
        >>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
        >>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
        >>>
        >>> For i As Integer = 1 To 8
        >>>
        >>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" &
        >>> i)
        >>>
        >>> If Not pcb Is Nothing Then
        >>>
        >>> pcb.Image = Image.FromFile( String.Format(f older, i))
        >>>
        >>> 'Else
        >>>
        >>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
        >>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
        >>>
        >>> End If
        >>>
        >>> Next i
        >>>
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • Homer J Simpson

          #5
          Re: DEADLINE! Please help!


          "KitKat" <kitkat@nospam. com> wrote in message
          news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...[color=blue]
          > I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam
          > 7, and Cam 8. Well it does that but it also needs to change the file name
          > to the same folder where the file is being grabbed, BUT it doesn't. I have
          > tried and tried.....pleas e help
          >
          > example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
          > 7\Cam7-20060224170000-01.jpg
          >
          > Cam7 but all I keep getting is Cam1, as the beginning of the jpg
          > name,...:( HELP![/color]

          It would help if you gave a clearer and concrete example, like

          From ===> To

          C:\Projects\Dar ryl\Queue Review Files\2-24\Cam7\01.jpg ===>
          C:\Projects\Dar ryl\Queue Review Files\2-24\Cam7\Cam7-20060224170000-01.jpg

          and explained where the parts of Cam7-20060224170000-01 come from, like

          Cam7 is the folder

          20060224170000 is the date and ???

          01 is the image name -- or whatever.



          Comment

          • Cor Ligthert [MVP]

            #6
            Re: DEADLINE! Please help!

            KitKat,

            I adviced you to make your procedure more maintainable and showable to
            replace that complete datetime stuff by just an array created by a string
            split, you ignored that any reason?

            Cor

            "KitKat" <kitkat@nospam. com> schreef in bericht
            news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...[color=blue]
            >I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam
            >7, and Cam 8. Well it does that but it also needs to change the file name
            >to the same folder where the file is being grabbed, BUT it doesn't. I have
            >tried and tried.....pleas e help
            >
            > example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
            > 7\Cam7-20060224170000-01.jpg
            >
            > Cam7 but all I keep getting is Cam1, as the beginning of the jpg
            > name,...:( HELP!
            >
            >
            >
            > Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
            > DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
            > Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
            >
            > For i As Integer = 1 To 8
            >
            > Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" & i)
            >
            > If Not pcb Is Nothing Then
            >
            > pcb.Image = Image.FromFile( String.Format(f older, i))
            >
            > 'Else
            >
            > ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
            > Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
            >
            > End If
            >
            > Next i
            >
            >[/color]


            Comment

            • KitKat

              #7
              Re: DEADLINE! Please help!

              It is part of the jpg file name that won't change not a folder.
              "Cam1-33333335649.jpg " my code will look in the right folder but will only
              look for files with Cam1 in the file name, not Cam2, Cam4, Cam6, Cam7 or
              Cam8.. I will post more of my code thanks for helping. I appreciate it very
              much.

              Private Sub cmbDate_Selecte dIndexChanged(B yVal sender As System.Object,
              ByVal e As System.EventArg s) Handles cmbDate.Selecte dIndexChanged

              Try

              Dim dt As DateTime =
              DateTime.ParseE xact(cmbDate.It ems(cmbDate.Sel ectedIndex), "MMMM d, yyyy",
              Nothing)

              'loads with the default folder files Cam 1

              Dim path As String = "C:\Projects\Da rryl\Queue Review Files\" & dt.Month &
              "-" & dt.Day & "\Cam 1"

              Dim dir As New IO.DirectoryInf o(path)

              Dim files As IO.FileInfo() = dir.GetFiles("* .jpg")

              cmbTime.BeginUp date()

              cmbTime.Items.C lear()

              If files.Length > 0 Then

              cmbTime.Items.A ddRange(files)

              End If

              cmbTime.EndUpda te()

              Catch ex As Exception

              MessageBox.Show (ex.Message, "Error Querying Files", MessageBoxButto ns.OK,
              MessageBoxIcon. Error)

              End Try

              End Sub



              Public Class ApplicationCont rols

              Public Shared Function FindControl(ByV al owner As Form, ByVal name As
              String) As Control

              Dim propInfo As PropertyInfo = _

              owner.GetType() .GetProperty(na me, BindingFlags.Ig noreCase Or _

              BindingFlags.In stance Or BindingFlags.No nPublic Or BindingFlags.Pu blic)

              If Not propInfo Is Nothing Then

              Dim value As Object = propInfo.GetVal ue(owner, Nothing)

              If TypeOf value Is Control Then

              Return value

              End If

              End If

              Return Nothing

              End Function

              End Class





              Private Sub cmbTime_Selecte dIndexChanged(B yVal sender As System.Object,
              ByVal e As System.EventArg s) Handles cmbTime.Selecte dIndexChanged

              Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
              DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
              Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text

              'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
              DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
              Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text

              For i As Integer = 1 To 8

              Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" & i)

              If Not pcb Is Nothing Then

              pcb.Image = Image.FromFile( String.Format(f older, i)) <<<errors out and
              points here

              'Else

              ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review Files\2-24\Cam
              7\Cam7-20060224170000-01.jpg")

              End If

              Next i

              End Sub



              "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
              news:OdGVvyvTGH A.5808@TK2MSFTN GP12.phx.gbl...[color=blue]
              > So where does the "Cam" prefix in the file name come from.
              > The code you posted doesn't show it.
              >
              > "cmbTime.Te xt" what is this cmbTime object, it sounds like that's where
              > the bug is.
              >
              >
              > "KitKat" <kitkat@nospam. com> wrote in message
              > news:%23DDDhevT GHA.1868@TK2MSF TNGP09.phx.gbl. ..[color=green]
              >> Thanks Mike for the help!
              >>
              >> That snippet changes the file name to: C:\Projects\Dar ryl\Queue Review
              >> Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg
              >>
              >> :(
              >>
              >>
              >> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
              >> news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...[color=darkred]
              >>> What does happen...
              >>> I do not see the Format specifier to change the file name...
              >>>
              >>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
              >>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
              >>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
              >>>
              >>> --
              >>> mike
              >>>
              >>> "KitKat" <kitkat@nospam. com> wrote in message
              >>> news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...
              >>>>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6,
              >>>>Cam 7, and Cam 8. Well it does that but it also needs to change the file
              >>>>name to the same folder where the file is being grabbed, BUT it doesn't.
              >>>>I have tried and tried.....pleas e help
              >>>>
              >>>> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
              >>>> 7\Cam7-20060224170000-01.jpg
              >>>>
              >>>> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
              >>>> name,...:( HELP!
              >>>>
              >>>>
              >>>>
              >>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
              >>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
              >>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
              >>>>
              >>>> For i As Integer = 1 To 8
              >>>>
              >>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" &
              >>>> i)
              >>>>
              >>>> If Not pcb Is Nothing Then
              >>>>
              >>>> pcb.Image = Image.FromFile( String.Format(f older, i))
              >>>>
              >>>> 'Else
              >>>>
              >>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
              >>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
              >>>>
              >>>> End If
              >>>>
              >>>> Next i
              >>>>
              >>>>
              >>>
              >>>[/color]
              >>
              >>[/color]
              >
              >[/color]


              Comment

              • Stephany Young

                #8
                Re: DEADLINE! Please help!

                The reason anyone not really able to help you is that you are not giving us
                the full information.

                You indicate that an exception occurs at the line:

                pcb.Image = Image.FromFile( String.Format(f older, i))

                What is the exception?

                What value is String.Format(f older, i) producing?
                To find out, try:
                Console.Writeli ne(String.Forma t(folder, i))
                at the appropriate point.

                You also have a ComboBox? (cmbTime) from which you are getting the last part
                of the filename. What is the value you are getting from that control?

                When you have the answers to these questions, come back and we might be able
                to help you.


                "KitKat" <kitkat@nospam. com> wrote in message
                news:OA1UXkyTGH A.5264@TK2MSFTN GP10.phx.gbl...[color=blue]
                > It is part of the jpg file name that won't change not a folder.
                > "Cam1-33333335649.jpg " my code will look in the right folder but will only
                > look for files with Cam1 in the file name, not Cam2, Cam4, Cam6, Cam7 or
                > Cam8.. I will post more of my code thanks for helping. I appreciate it
                > very much.
                >
                > Private Sub cmbDate_Selecte dIndexChanged(B yVal sender As System.Object,
                > ByVal e As System.EventArg s) Handles cmbDate.Selecte dIndexChanged
                >
                > Try
                >
                > Dim dt As DateTime =
                > DateTime.ParseE xact(cmbDate.It ems(cmbDate.Sel ectedIndex), "MMMM d, yyyy",
                > Nothing)
                >
                > 'loads with the default folder files Cam 1
                >
                > Dim path As String = "C:\Projects\Da rryl\Queue Review Files\" & dt.Month &
                > "-" & dt.Day & "\Cam 1"
                >
                > Dim dir As New IO.DirectoryInf o(path)
                >
                > Dim files As IO.FileInfo() = dir.GetFiles("* .jpg")
                >
                > cmbTime.BeginUp date()
                >
                > cmbTime.Items.C lear()
                >
                > If files.Length > 0 Then
                >
                > cmbTime.Items.A ddRange(files)
                >
                > End If
                >
                > cmbTime.EndUpda te()
                >
                > Catch ex As Exception
                >
                > MessageBox.Show (ex.Message, "Error Querying Files", MessageBoxButto ns.OK,
                > MessageBoxIcon. Error)
                >
                > End Try
                >
                > End Sub
                >
                >
                >
                > Public Class ApplicationCont rols
                >
                > Public Shared Function FindControl(ByV al owner As Form, ByVal name As
                > String) As Control
                >
                > Dim propInfo As PropertyInfo = _
                >
                > owner.GetType() .GetProperty(na me, BindingFlags.Ig noreCase Or _
                >
                > BindingFlags.In stance Or BindingFlags.No nPublic Or BindingFlags.Pu blic)
                >
                > If Not propInfo Is Nothing Then
                >
                > Dim value As Object = propInfo.GetVal ue(owner, Nothing)
                >
                > If TypeOf value Is Control Then
                >
                > Return value
                >
                > End If
                >
                > End If
                >
                > Return Nothing
                >
                > End Function
                >
                > End Class
                >
                >
                >
                >
                >
                > Private Sub cmbTime_Selecte dIndexChanged(B yVal sender As System.Object,
                > ByVal e As System.EventArg s) Handles cmbTime.Selecte dIndexChanged
                >
                > Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                > DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                > Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                >
                > 'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                > DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                > Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                >
                > For i As Integer = 1 To 8
                >
                > Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" & i)
                >
                > If Not pcb Is Nothing Then
                >
                > pcb.Image = Image.FromFile( String.Format(f older, i)) <<<errors out and
                > points here
                >
                > 'Else
                >
                > ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                > Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                >
                > End If
                >
                > Next i
                >
                > End Sub
                >
                >
                >
                > "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                > news:OdGVvyvTGH A.5808@TK2MSFTN GP12.phx.gbl...[color=green]
                >> So where does the "Cam" prefix in the file name come from.
                >> The code you posted doesn't show it.
                >>
                >> "cmbTime.Te xt" what is this cmbTime object, it sounds like that's where
                >> the bug is.
                >>
                >>
                >> "KitKat" <kitkat@nospam. com> wrote in message
                >> news:%23DDDhevT GHA.1868@TK2MSF TNGP09.phx.gbl. ..[color=darkred]
                >>> Thanks Mike for the help!
                >>>
                >>> That snippet changes the file name to: C:\Projects\Dar ryl\Queue Review
                >>> Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg
                >>>
                >>> :(
                >>>
                >>>
                >>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                >>> news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...
                >>>> What does happen...
                >>>> I do not see the Format specifier to change the file name...
                >>>>
                >>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                >>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                >>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                >>>>
                >>>> --
                >>>> mike
                >>>>
                >>>> "KitKat" <kitkat@nospam. com> wrote in message
                >>>> news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...
                >>>>>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6,
                >>>>>Cam 7, and Cam 8. Well it does that but it also needs to change the
                >>>>>file name to the same folder where the file is being grabbed, BUT it
                >>>>>doesn't. I have tried and tried.....pleas e help
                >>>>>
                >>>>> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                >>>>> 7\Cam7-20060224170000-01.jpg
                >>>>>
                >>>>> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
                >>>>> name,...:( HELP!
                >>>>>
                >>>>>
                >>>>>
                >>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                >>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                >>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                >>>>>
                >>>>> For i As Integer = 1 To 8
                >>>>>
                >>>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" &
                >>>>> i)
                >>>>>
                >>>>> If Not pcb Is Nothing Then
                >>>>>
                >>>>> pcb.Image = Image.FromFile( String.Format(f older, i))
                >>>>>
                >>>>> 'Else
                >>>>>
                >>>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                >>>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                >>>>>
                >>>>> End If
                >>>>>
                >>>>> Next i
                >>>>>
                >>>>>
                >>>>
                >>>>
                >>>
                >>>[/color]
                >>
                >>[/color]
                >
                >[/color]


                Comment

                • KitKat

                  #9
                  Re: DEADLINE! Please help!

                  Sorry I am just learning this stuff. Can you show me what you mean? I have
                  posted my code below. Thanks for your input.

                  Private Sub cmbDate_Selecte dIndexChanged(B yVal sender As System.Object,
                  ByVal e As System.EventArg s) Handles cmbDate.Selecte dIndexChanged

                  Try

                  Dim dt As DateTime =
                  DateTime.ParseE xact(cmbDate.It ems(cmbDate.Sel ectedIndex), "MMMM d, yyyy",
                  Nothing)

                  'loads with the default folder files Cam 1

                  Dim path As String = "C:\Projects\Da rryl\Queue Review Files\" & dt.Month &
                  "-" & dt.Day & "\Cam 1"

                  Dim dir As New IO.DirectoryInf o(path)

                  Dim files As IO.FileInfo() = dir.GetFiles("* .jpg")

                  cmbTime.BeginUp date()

                  cmbTime.Items.C lear()

                  If files.Length > 0 Then

                  cmbTime.Items.A ddRange(files)

                  End If

                  cmbTime.EndUpda te()

                  Catch ex As Exception

                  MessageBox.Show (ex.Message, "Error Querying Files", MessageBoxButto ns.OK,
                  MessageBoxIcon. Error)

                  End Try

                  End Sub



                  Public Class ApplicationCont rols

                  Public Shared Function FindControl(ByV al owner As Form, ByVal name As
                  String) As Control

                  Dim propInfo As PropertyInfo = _

                  owner.GetType() .GetProperty(na me, BindingFlags.Ig noreCase Or _

                  BindingFlags.In stance Or BindingFlags.No nPublic Or BindingFlags.Pu blic)

                  If Not propInfo Is Nothing Then

                  Dim value As Object = propInfo.GetVal ue(owner, Nothing)

                  If TypeOf value Is Control Then

                  Return value

                  End If

                  End If

                  Return Nothing

                  End Function

                  End Class

                  Private Sub cmbTime_Selecte dIndexChanged(B yVal sender As System.Object,
                  ByVal e As System.EventArg s) Handles cmbTime.Selecte dIndexChanged

                  Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                  DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                  Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text

                  'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                  DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                  Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text

                  For i As Integer = 1 To 8

                  Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" & i)

                  If Not pcb Is Nothing Then

                  pcb.Image = Image.FromFile( String.Format(f older, i))

                  'Else

                  ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review Files\2-24\Cam
                  7\Cam7-20060224170000-01.jpg")

                  End If

                  Next i

                  End Sub

                  "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> wrote in message
                  news:uzW9m1wTGH A.4864@TK2MSFTN GP12.phx.gbl...[color=blue]
                  > KitKat,
                  >
                  > I adviced you to make your procedure more maintainable and showable to
                  > replace that complete datetime stuff by just an array created by a string
                  > split, you ignored that any reason?
                  >
                  > Cor
                  >
                  > "KitKat" <kitkat@nospam. com> schreef in bericht
                  > news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...[color=green]
                  >>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam
                  >>7, and Cam 8. Well it does that but it also needs to change the file name
                  >>to the same folder where the file is being grabbed, BUT it doesn't. I have
                  >>tried and tried.....pleas e help
                  >>
                  >> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                  >> 7\Cam7-20060224170000-01.jpg
                  >>
                  >> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
                  >> name,...:( HELP!
                  >>
                  >>
                  >>
                  >> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                  >> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                  >> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                  >>
                  >> For i As Integer = 1 To 8
                  >>
                  >> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" & i)
                  >>
                  >> If Not pcb Is Nothing Then
                  >>
                  >> pcb.Image = Image.FromFile( String.Format(f older, i))
                  >>
                  >> 'Else
                  >>
                  >> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                  >> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                  >>
                  >> End If
                  >>
                  >> Next i
                  >>
                  >>[/color]
                  >
                  >[/color]


                  Comment

                  • KitKat

                    #10
                    Re: DEADLINE! Please help!

                    Thanks for helping Stephany.

                    The exception is: FileNotFoundExc eption was unhandled
                    C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1\Cam
                    1-Cam1-20060224165649-01.jpg
                    cannnot be found, that is because the file is actually:
                    C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1\Cam1-20060224165649-01.jpg

                    String.Format is producing:
                    FOLDER:
                    C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                    {0}\Cam1-20060224170000-01.jpg

                    VALUE: TYPE:
                    pcb.Image Nothing System. Drawing.Image

                    From the combo box cmbTime getting the files associated with the date
                    selected in my combo box cmbDate, which defaults to each Cam 1 folder.
                    C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1

                    C:\Projects\Dar ryl\Queue Review Files\2-27\Cam 7\

                    C:\Projects\Dar ryl\Queue Review Files\2-28\Cam 7\

                    is that what you asked? thanks for helping I am really sorry for the hassle.









                    "Stephany Young" <noone@localhos t> wrote in message
                    news:%237ArU9yT GHA.4492@TK2MSF TNGP09.phx.gbl. ..[color=blue]
                    > The reason anyone not really able to help you is that you are not giving
                    > us the full information.
                    >
                    > You indicate that an exception occurs at the line:
                    >
                    > pcb.Image = Image.FromFile( String.Format(f older, i))
                    >
                    > What is the exception?
                    >
                    > What value is String.Format(f older, i) producing?
                    > To find out, try:
                    > Console.Writeli ne(String.Forma t(folder, i))
                    > at the appropriate point.
                    >
                    > You also have a ComboBox? (cmbTime) from which you are getting the last
                    > part of the filename. What is the value you are getting from that control?
                    >
                    > When you have the answers to these questions, come back and we might be
                    > able to help you.
                    >
                    >
                    > "KitKat" <kitkat@nospam. com> wrote in message
                    > news:OA1UXkyTGH A.5264@TK2MSFTN GP10.phx.gbl...[color=green]
                    >> It is part of the jpg file name that won't change not a folder.
                    >> "Cam1-33333335649.jpg " my code will look in the right folder but will
                    >> only look for files with Cam1 in the file name, not Cam2, Cam4, Cam6,
                    >> Cam7 or Cam8.. I will post more of my code thanks for helping. I
                    >> appreciate it very much.
                    >>
                    >> Private Sub cmbDate_Selecte dIndexChanged(B yVal sender As System.Object,
                    >> ByVal e As System.EventArg s) Handles cmbDate.Selecte dIndexChanged
                    >>
                    >> Try
                    >>
                    >> Dim dt As DateTime =
                    >> DateTime.ParseE xact(cmbDate.It ems(cmbDate.Sel ectedIndex), "MMMM d, yyyy",
                    >> Nothing)
                    >>
                    >> 'loads with the default folder files Cam 1
                    >>
                    >> Dim path As String = "C:\Projects\Da rryl\Queue Review Files\" & dt.Month
                    >> & "-" & dt.Day & "\Cam 1"
                    >>
                    >> Dim dir As New IO.DirectoryInf o(path)
                    >>
                    >> Dim files As IO.FileInfo() = dir.GetFiles("* .jpg")
                    >>
                    >> cmbTime.BeginUp date()
                    >>
                    >> cmbTime.Items.C lear()
                    >>
                    >> If files.Length > 0 Then
                    >>
                    >> cmbTime.Items.A ddRange(files)
                    >>
                    >> End If
                    >>
                    >> cmbTime.EndUpda te()
                    >>
                    >> Catch ex As Exception
                    >>
                    >> MessageBox.Show (ex.Message, "Error Querying Files", MessageBoxButto ns.OK,
                    >> MessageBoxIcon. Error)
                    >>
                    >> End Try
                    >>
                    >> End Sub
                    >>
                    >>
                    >>
                    >> Public Class ApplicationCont rols
                    >>
                    >> Public Shared Function FindControl(ByV al owner As Form, ByVal name As
                    >> String) As Control
                    >>
                    >> Dim propInfo As PropertyInfo = _
                    >>
                    >> owner.GetType() .GetProperty(na me, BindingFlags.Ig noreCase Or _
                    >>
                    >> BindingFlags.In stance Or BindingFlags.No nPublic Or BindingFlags.Pu blic)
                    >>
                    >> If Not propInfo Is Nothing Then
                    >>
                    >> Dim value As Object = propInfo.GetVal ue(owner, Nothing)
                    >>
                    >> If TypeOf value Is Control Then
                    >>
                    >> Return value
                    >>
                    >> End If
                    >>
                    >> End If
                    >>
                    >> Return Nothing
                    >>
                    >> End Function
                    >>
                    >> End Class
                    >>
                    >>
                    >>
                    >>
                    >>
                    >> Private Sub cmbTime_Selecte dIndexChanged(B yVal sender As System.Object,
                    >> ByVal e As System.EventArg s) Handles cmbTime.Selecte dIndexChanged
                    >>
                    >> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                    >> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                    >> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                    >>
                    >> 'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                    >> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                    >> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                    >>
                    >> For i As Integer = 1 To 8
                    >>
                    >> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" & i)
                    >>
                    >> If Not pcb Is Nothing Then
                    >>
                    >> pcb.Image = Image.FromFile( String.Format(f older, i)) <<<errors out and
                    >> points here
                    >>
                    >> 'Else
                    >>
                    >> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                    >> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                    >>
                    >> End If
                    >>
                    >> Next i
                    >>
                    >> End Sub
                    >>
                    >>
                    >>
                    >> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                    >> news:OdGVvyvTGH A.5808@TK2MSFTN GP12.phx.gbl...[color=darkred]
                    >>> So where does the "Cam" prefix in the file name come from.
                    >>> The code you posted doesn't show it.
                    >>>
                    >>> "cmbTime.Te xt" what is this cmbTime object, it sounds like that's where
                    >>> the bug is.
                    >>>
                    >>>
                    >>> "KitKat" <kitkat@nospam. com> wrote in message
                    >>> news:%23DDDhevT GHA.1868@TK2MSF TNGP09.phx.gbl. ..
                    >>>> Thanks Mike for the help!
                    >>>>
                    >>>> That snippet changes the file name to: C:\Projects\Dar ryl\Queue Review
                    >>>> Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg
                    >>>>
                    >>>> :(
                    >>>>
                    >>>>
                    >>>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                    >>>> news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...
                    >>>>> What does happen...
                    >>>>> I do not see the Format specifier to change the file name...
                    >>>>>
                    >>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                    >>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                    >>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                    >>>>>
                    >>>>> --
                    >>>>> mike
                    >>>>>
                    >>>>> "KitKat" <kitkat@nospam. com> wrote in message
                    >>>>> news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...
                    >>>>>>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6,
                    >>>>>>Cam 7, and Cam 8. Well it does that but it also needs to change the
                    >>>>>>file name to the same folder where the file is being grabbed, BUT it
                    >>>>>>doesn't . I have tried and tried.....pleas e help
                    >>>>>>
                    >>>>>> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                    >>>>>> 7\Cam7-20060224170000-01.jpg
                    >>>>>>
                    >>>>>> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
                    >>>>>> name,...:( HELP!
                    >>>>>>
                    >>>>>>
                    >>>>>>
                    >>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                    >>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                    >>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                    >>>>>>
                    >>>>>> For i As Integer = 1 To 8
                    >>>>>>
                    >>>>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam"
                    >>>>>> & i)
                    >>>>>>
                    >>>>>> If Not pcb Is Nothing Then
                    >>>>>>
                    >>>>>> pcb.Image = Image.FromFile( String.Format(f older, i))
                    >>>>>>
                    >>>>>> 'Else
                    >>>>>>
                    >>>>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                    >>>>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                    >>>>>>
                    >>>>>> End If
                    >>>>>>
                    >>>>>> Next i
                    >>>>>>
                    >>>>>>
                    >>>>>
                    >>>>>
                    >>>>
                    >>>>
                    >>>
                    >>>[/color]
                    >>
                    >>[/color]
                    >
                    >[/color]


                    Comment

                    • Stephany Young

                      #11
                      Re: DEADLINE! Please help!

                      No....

                      I think that you are misinterpreting the questions.

                      You have 2 Comboxes.

                      One ComboBox (cmbDate) has some values like "2-24" etc.

                      The other ComboBox (cmbTime) has (I suspect) some filenames that you think
                      are like "2006022416 5649-01.jpg" etc.

                      From what you are reporting I suspect that the values in cmbTime actually
                      have values more like "Cam1-20060224165649-01.jpg" etc.

                      Until we know what your exact values are we are shooting in the dark.



                      "KitKat" <kitkat@nospam. com> wrote in message
                      news:%23WoNf90T GHA.5464@TK2MSF TNGP10.phx.gbl. ..[color=blue]
                      > Thanks for helping Stephany.
                      >
                      > The exception is: FileNotFoundExc eption was unhandled
                      > C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1\Cam
                      > 1-Cam1-20060224165649-01.jpg
                      > cannnot be found, that is because the file is actually:
                      > C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                      > 1\Cam1-20060224165649-01.jpg
                      >
                      > String.Format is producing:
                      > FOLDER:
                      > C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                      > {0}\Cam1-20060224170000-01.jpg
                      >
                      > VALUE: TYPE:
                      > pcb.Image Nothing System. Drawing.Image
                      >
                      > From the combo box cmbTime getting the files associated with the date
                      > selected in my combo box cmbDate, which defaults to each Cam 1 folder.
                      > C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1
                      >
                      > C:\Projects\Dar ryl\Queue Review Files\2-27\Cam 7\
                      >
                      > C:\Projects\Dar ryl\Queue Review Files\2-28\Cam 7\
                      >
                      > is that what you asked? thanks for helping I am really sorry for the
                      > hassle.
                      >
                      >
                      >
                      >
                      >
                      >
                      >
                      >
                      >
                      > "Stephany Young" <noone@localhos t> wrote in message
                      > news:%237ArU9yT GHA.4492@TK2MSF TNGP09.phx.gbl. ..[color=green]
                      >> The reason anyone not really able to help you is that you are not giving
                      >> us the full information.
                      >>
                      >> You indicate that an exception occurs at the line:
                      >>
                      >> pcb.Image = Image.FromFile( String.Format(f older, i))
                      >>
                      >> What is the exception?
                      >>
                      >> What value is String.Format(f older, i) producing?
                      >> To find out, try:
                      >> Console.Writeli ne(String.Forma t(folder, i))
                      >> at the appropriate point.
                      >>
                      >> You also have a ComboBox? (cmbTime) from which you are getting the last
                      >> part of the filename. What is the value you are getting from that
                      >> control?
                      >>
                      >> When you have the answers to these questions, come back and we might be
                      >> able to help you.
                      >>
                      >>
                      >> "KitKat" <kitkat@nospam. com> wrote in message
                      >> news:OA1UXkyTGH A.5264@TK2MSFTN GP10.phx.gbl...[color=darkred]
                      >>> It is part of the jpg file name that won't change not a folder.
                      >>> "Cam1-33333335649.jpg " my code will look in the right folder but will
                      >>> only look for files with Cam1 in the file name, not Cam2, Cam4, Cam6,
                      >>> Cam7 or Cam8.. I will post more of my code thanks for helping. I
                      >>> appreciate it very much.
                      >>>
                      >>> Private Sub cmbDate_Selecte dIndexChanged(B yVal sender As System.Object,
                      >>> ByVal e As System.EventArg s) Handles cmbDate.Selecte dIndexChanged
                      >>>
                      >>> Try
                      >>>
                      >>> Dim dt As DateTime =
                      >>> DateTime.ParseE xact(cmbDate.It ems(cmbDate.Sel ectedIndex), "MMMM d,
                      >>> yyyy", Nothing)
                      >>>
                      >>> 'loads with the default folder files Cam 1
                      >>>
                      >>> Dim path As String = "C:\Projects\Da rryl\Queue Review Files\" & dt.Month
                      >>> & "-" & dt.Day & "\Cam 1"
                      >>>
                      >>> Dim dir As New IO.DirectoryInf o(path)
                      >>>
                      >>> Dim files As IO.FileInfo() = dir.GetFiles("* .jpg")
                      >>>
                      >>> cmbTime.BeginUp date()
                      >>>
                      >>> cmbTime.Items.C lear()
                      >>>
                      >>> If files.Length > 0 Then
                      >>>
                      >>> cmbTime.Items.A ddRange(files)
                      >>>
                      >>> End If
                      >>>
                      >>> cmbTime.EndUpda te()
                      >>>
                      >>> Catch ex As Exception
                      >>>
                      >>> MessageBox.Show (ex.Message, "Error Querying Files",
                      >>> MessageBoxButto ns.OK, MessageBoxIcon. Error)
                      >>>
                      >>> End Try
                      >>>
                      >>> End Sub
                      >>>
                      >>>
                      >>>
                      >>> Public Class ApplicationCont rols
                      >>>
                      >>> Public Shared Function FindControl(ByV al owner As Form, ByVal name As
                      >>> String) As Control
                      >>>
                      >>> Dim propInfo As PropertyInfo = _
                      >>>
                      >>> owner.GetType() .GetProperty(na me, BindingFlags.Ig noreCase Or _
                      >>>
                      >>> BindingFlags.In stance Or BindingFlags.No nPublic Or BindingFlags.Pu blic)
                      >>>
                      >>> If Not propInfo Is Nothing Then
                      >>>
                      >>> Dim value As Object = propInfo.GetVal ue(owner, Nothing)
                      >>>
                      >>> If TypeOf value Is Control Then
                      >>>
                      >>> Return value
                      >>>
                      >>> End If
                      >>>
                      >>> End If
                      >>>
                      >>> Return Nothing
                      >>>
                      >>> End Function
                      >>>
                      >>> End Class
                      >>>
                      >>>
                      >>>
                      >>>
                      >>>
                      >>> Private Sub cmbTime_Selecte dIndexChanged(B yVal sender As System.Object,
                      >>> ByVal e As System.EventArg s) Handles cmbTime.Selecte dIndexChanged
                      >>>
                      >>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                      >>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                      >>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                      >>>
                      >>> 'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                      >>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                      >>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                      >>>
                      >>> For i As Integer = 1 To 8
                      >>>
                      >>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" &
                      >>> i)
                      >>>
                      >>> If Not pcb Is Nothing Then
                      >>>
                      >>> pcb.Image = Image.FromFile( String.Format(f older, i)) <<<errors out and
                      >>> points here
                      >>>
                      >>> 'Else
                      >>>
                      >>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                      >>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                      >>>
                      >>> End If
                      >>>
                      >>> Next i
                      >>>
                      >>> End Sub
                      >>>
                      >>>
                      >>>
                      >>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                      >>> news:OdGVvyvTGH A.5808@TK2MSFTN GP12.phx.gbl...
                      >>>> So where does the "Cam" prefix in the file name come from.
                      >>>> The code you posted doesn't show it.
                      >>>>
                      >>>> "cmbTime.Te xt" what is this cmbTime object, it sounds like that's where
                      >>>> the bug is.
                      >>>>
                      >>>>
                      >>>> "KitKat" <kitkat@nospam. com> wrote in message
                      >>>> news:%23DDDhevT GHA.1868@TK2MSF TNGP09.phx.gbl. ..
                      >>>>> Thanks Mike for the help!
                      >>>>>
                      >>>>> That snippet changes the file name to: C:\Projects\Dar ryl\Queue Review
                      >>>>> Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg
                      >>>>>
                      >>>>> :(
                      >>>>>
                      >>>>>
                      >>>>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                      >>>>> news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...
                      >>>>>> What does happen...
                      >>>>>> I do not see the Format specifier to change the file name...
                      >>>>>>
                      >>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                      >>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                      >>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                      >>>>>>
                      >>>>>> --
                      >>>>>> mike
                      >>>>>>
                      >>>>>> "KitKat" <kitkat@nospam. com> wrote in message
                      >>>>>> news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...
                      >>>>>>>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6,
                      >>>>>>>Cam 7, and Cam 8. Well it does that but it also needs to change the
                      >>>>>>>file name to the same folder where the file is being grabbed, BUT it
                      >>>>>>>doesn' t. I have tried and tried.....pleas e help
                      >>>>>>>
                      >>>>>>> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                      >>>>>>> 7\Cam7-20060224170000-01.jpg
                      >>>>>>>
                      >>>>>>> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
                      >>>>>>> name,...:( HELP!
                      >>>>>>>
                      >>>>>>>
                      >>>>>>>
                      >>>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                      >>>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                      >>>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                      >>>>>>>
                      >>>>>>> For i As Integer = 1 To 8
                      >>>>>>>
                      >>>>>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam"
                      >>>>>>> & i)
                      >>>>>>>
                      >>>>>>> If Not pcb Is Nothing Then
                      >>>>>>>
                      >>>>>>> pcb.Image = Image.FromFile( String.Format(f older, i))
                      >>>>>>>
                      >>>>>>> 'Else
                      >>>>>>>
                      >>>>>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                      >>>>>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                      >>>>>>>
                      >>>>>>> End If
                      >>>>>>>
                      >>>>>>> Next i
                      >>>>>>>
                      >>>>>>>
                      >>>>>>
                      >>>>>>
                      >>>>>
                      >>>>>
                      >>>>
                      >>>>
                      >>>
                      >>>[/color]
                      >>
                      >>[/color]
                      >
                      >[/color]


                      Comment

                      • KitKat

                        #12
                        Re: DEADLINE! Please help!

                        I have tried:
                        'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                        DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                        Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text

                        'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                        DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                        Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text

                        Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                        DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                        Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Selecte dItem.ToString

                        all basically the same result, the jpg found is not the right name of the
                        folder.



                        Thanks for assistance.

                        "KitKat" <kitkat@nospam. com> wrote in message
                        news:%23WoNf90T GHA.5464@TK2MSF TNGP10.phx.gbl. ..[color=blue]
                        > Thanks for helping Stephany.
                        >
                        > The exception is: FileNotFoundExc eption was unhandled
                        > C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1\Cam
                        > 1-Cam1-20060224165649-01.jpg
                        > cannnot be found, that is because the file is actually:
                        > C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                        > 1\Cam1-20060224165649-01.jpg
                        >
                        > String.Format is producing:
                        > FOLDER:
                        > C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                        > {0}\Cam1-20060224170000-01.jpg
                        >
                        > VALUE: TYPE:
                        > pcb.Image Nothing System. Drawing.Image
                        >
                        > From the combo box cmbTime getting the files associated with the date
                        > selected in my combo box cmbDate, which defaults to each Cam 1 folder.
                        > C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1
                        >
                        > C:\Projects\Dar ryl\Queue Review Files\2-27\Cam 7\
                        >
                        > C:\Projects\Dar ryl\Queue Review Files\2-28\Cam 7\
                        >
                        > is that what you asked? thanks for helping I am really sorry for the
                        > hassle.
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        > "Stephany Young" <noone@localhos t> wrote in message
                        > news:%237ArU9yT GHA.4492@TK2MSF TNGP09.phx.gbl. ..[color=green]
                        >> The reason anyone not really able to help you is that you are not giving
                        >> us the full information.
                        >>
                        >> You indicate that an exception occurs at the line:
                        >>
                        >> pcb.Image = Image.FromFile( String.Format(f older, i))
                        >>
                        >> What is the exception?
                        >>
                        >> What value is String.Format(f older, i) producing?
                        >> To find out, try:
                        >> Console.Writeli ne(String.Forma t(folder, i))
                        >> at the appropriate point.
                        >>
                        >> You also have a ComboBox? (cmbTime) from which you are getting the last
                        >> part of the filename. What is the value you are getting from that
                        >> control?
                        >>
                        >> When you have the answers to these questions, come back and we might be
                        >> able to help you.
                        >>
                        >>
                        >> "KitKat" <kitkat@nospam. com> wrote in message
                        >> news:OA1UXkyTGH A.5264@TK2MSFTN GP10.phx.gbl...[color=darkred]
                        >>> It is part of the jpg file name that won't change not a folder.
                        >>> "Cam1-33333335649.jpg " my code will look in the right folder but will
                        >>> only look for files with Cam1 in the file name, not Cam2, Cam4, Cam6,
                        >>> Cam7 or Cam8.. I will post more of my code thanks for helping. I
                        >>> appreciate it very much.
                        >>>
                        >>> Private Sub cmbDate_Selecte dIndexChanged(B yVal sender As System.Object,
                        >>> ByVal e As System.EventArg s) Handles cmbDate.Selecte dIndexChanged
                        >>>
                        >>> Try
                        >>>
                        >>> Dim dt As DateTime =
                        >>> DateTime.ParseE xact(cmbDate.It ems(cmbDate.Sel ectedIndex), "MMMM d,
                        >>> yyyy", Nothing)
                        >>>
                        >>> 'loads with the default folder files Cam 1
                        >>>
                        >>> Dim path As String = "C:\Projects\Da rryl\Queue Review Files\" & dt.Month
                        >>> & "-" & dt.Day & "\Cam 1"
                        >>>
                        >>> Dim dir As New IO.DirectoryInf o(path)
                        >>>
                        >>> Dim files As IO.FileInfo() = dir.GetFiles("* .jpg")
                        >>>
                        >>> cmbTime.BeginUp date()
                        >>>
                        >>> cmbTime.Items.C lear()
                        >>>
                        >>> If files.Length > 0 Then
                        >>>
                        >>> cmbTime.Items.A ddRange(files)
                        >>>
                        >>> End If
                        >>>
                        >>> cmbTime.EndUpda te()
                        >>>
                        >>> Catch ex As Exception
                        >>>
                        >>> MessageBox.Show (ex.Message, "Error Querying Files",
                        >>> MessageBoxButto ns.OK, MessageBoxIcon. Error)
                        >>>
                        >>> End Try
                        >>>
                        >>> End Sub
                        >>>
                        >>>
                        >>>
                        >>> Public Class ApplicationCont rols
                        >>>
                        >>> Public Shared Function FindControl(ByV al owner As Form, ByVal name As
                        >>> String) As Control
                        >>>
                        >>> Dim propInfo As PropertyInfo = _
                        >>>
                        >>> owner.GetType() .GetProperty(na me, BindingFlags.Ig noreCase Or _
                        >>>
                        >>> BindingFlags.In stance Or BindingFlags.No nPublic Or BindingFlags.Pu blic)
                        >>>
                        >>> If Not propInfo Is Nothing Then
                        >>>
                        >>> Dim value As Object = propInfo.GetVal ue(owner, Nothing)
                        >>>
                        >>> If TypeOf value Is Control Then
                        >>>
                        >>> Return value
                        >>>
                        >>> End If
                        >>>
                        >>> End If
                        >>>
                        >>> Return Nothing
                        >>>
                        >>> End Function
                        >>>
                        >>> End Class
                        >>>
                        >>>
                        >>>
                        >>>
                        >>>
                        >>> Private Sub cmbTime_Selecte dIndexChanged(B yVal sender As System.Object,
                        >>> ByVal e As System.EventArg s) Handles cmbTime.Selecte dIndexChanged
                        >>>
                        >>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                        >>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                        >>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                        >>>
                        >>> 'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                        >>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                        >>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                        >>>
                        >>> For i As Integer = 1 To 8
                        >>>
                        >>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" &
                        >>> i)
                        >>>
                        >>> If Not pcb Is Nothing Then
                        >>>
                        >>> pcb.Image = Image.FromFile( String.Format(f older, i)) <<<errors out and
                        >>> points here
                        >>>
                        >>> 'Else
                        >>>
                        >>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                        >>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                        >>>
                        >>> End If
                        >>>
                        >>> Next i
                        >>>
                        >>> End Sub
                        >>>
                        >>>
                        >>>
                        >>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                        >>> news:OdGVvyvTGH A.5808@TK2MSFTN GP12.phx.gbl...
                        >>>> So where does the "Cam" prefix in the file name come from.
                        >>>> The code you posted doesn't show it.
                        >>>>
                        >>>> "cmbTime.Te xt" what is this cmbTime object, it sounds like that's where
                        >>>> the bug is.
                        >>>>
                        >>>>
                        >>>> "KitKat" <kitkat@nospam. com> wrote in message
                        >>>> news:%23DDDhevT GHA.1868@TK2MSF TNGP09.phx.gbl. ..
                        >>>>> Thanks Mike for the help!
                        >>>>>
                        >>>>> That snippet changes the file name to: C:\Projects\Dar ryl\Queue Review
                        >>>>> Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg
                        >>>>>
                        >>>>> :(
                        >>>>>
                        >>>>>
                        >>>>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                        >>>>> news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...
                        >>>>>> What does happen...
                        >>>>>> I do not see the Format specifier to change the file name...
                        >>>>>>
                        >>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                        >>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                        >>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                        >>>>>>
                        >>>>>> --
                        >>>>>> mike
                        >>>>>>
                        >>>>>> "KitKat" <kitkat@nospam. com> wrote in message
                        >>>>>> news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...
                        >>>>>>>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6,
                        >>>>>>>Cam 7, and Cam 8. Well it does that but it also needs to change the
                        >>>>>>>file name to the same folder where the file is being grabbed, BUT it
                        >>>>>>>doesn' t. I have tried and tried.....pleas e help
                        >>>>>>>
                        >>>>>>> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                        >>>>>>> 7\Cam7-20060224170000-01.jpg
                        >>>>>>>
                        >>>>>>> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
                        >>>>>>> name,...:( HELP!
                        >>>>>>>
                        >>>>>>>
                        >>>>>>>
                        >>>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                        >>>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                        >>>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                        >>>>>>>
                        >>>>>>> For i As Integer = 1 To 8
                        >>>>>>>
                        >>>>>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam"
                        >>>>>>> & i)
                        >>>>>>>
                        >>>>>>> If Not pcb Is Nothing Then
                        >>>>>>>
                        >>>>>>> pcb.Image = Image.FromFile( String.Format(f older, i))
                        >>>>>>>
                        >>>>>>> 'Else
                        >>>>>>>
                        >>>>>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                        >>>>>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                        >>>>>>>
                        >>>>>>> End If
                        >>>>>>>
                        >>>>>>> Next i
                        >>>>>>>
                        >>>>>>>
                        >>>>>>
                        >>>>>>
                        >>>>>
                        >>>>>
                        >>>>
                        >>>>
                        >>>
                        >>>[/color]
                        >>
                        >>[/color]
                        >
                        >[/color]


                        Comment

                        • Stephany Young

                          #13
                          Re: DEADLINE! Please help!

                          For each of your 8 cams, can you please post the actual name (fully
                          qualified) of a file that actually exists on you C drive.


                          "KitKat" <kitkat@nospam. com> wrote in message
                          news:u%23n94H1T GHA.4952@TK2MSF TNGP09.phx.gbl. ..[color=blue]
                          >I have tried:
                          > 'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                          > DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                          > Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                          >
                          > 'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                          > DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                          > Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                          >
                          > Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                          > DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                          > Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Selecte dItem.ToString
                          >
                          > all basically the same result, the jpg found is not the right name of the
                          > folder.
                          >
                          >
                          >
                          > Thanks for assistance.
                          >
                          > "KitKat" <kitkat@nospam. com> wrote in message
                          > news:%23WoNf90T GHA.5464@TK2MSF TNGP10.phx.gbl. ..[color=green]
                          >> Thanks for helping Stephany.
                          >>
                          >> The exception is: FileNotFoundExc eption was unhandled
                          >> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1\Cam
                          >> 1-Cam1-20060224165649-01.jpg
                          >> cannnot be found, that is because the file is actually:
                          >> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                          >> 1\Cam1-20060224165649-01.jpg
                          >>
                          >> String.Format is producing:
                          >> FOLDER:
                          >> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                          >> {0}\Cam1-20060224170000-01.jpg
                          >>
                          >> VALUE: TYPE:
                          >> pcb.Image Nothing System. Drawing.Image
                          >>
                          >> From the combo box cmbTime getting the files associated with the date
                          >> selected in my combo box cmbDate, which defaults to each Cam 1 folder.
                          >> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1
                          >>
                          >> C:\Projects\Dar ryl\Queue Review Files\2-27\Cam 7\
                          >>
                          >> C:\Projects\Dar ryl\Queue Review Files\2-28\Cam 7\
                          >>
                          >> is that what you asked? thanks for helping I am really sorry for the
                          >> hassle.
                          >>
                          >>
                          >>
                          >>
                          >>
                          >>
                          >>
                          >>
                          >>
                          >> "Stephany Young" <noone@localhos t> wrote in message
                          >> news:%237ArU9yT GHA.4492@TK2MSF TNGP09.phx.gbl. ..[color=darkred]
                          >>> The reason anyone not really able to help you is that you are not giving
                          >>> us the full information.
                          >>>
                          >>> You indicate that an exception occurs at the line:
                          >>>
                          >>> pcb.Image = Image.FromFile( String.Format(f older, i))
                          >>>
                          >>> What is the exception?
                          >>>
                          >>> What value is String.Format(f older, i) producing?
                          >>> To find out, try:
                          >>> Console.Writeli ne(String.Forma t(folder, i))
                          >>> at the appropriate point.
                          >>>
                          >>> You also have a ComboBox? (cmbTime) from which you are getting the last
                          >>> part of the filename. What is the value you are getting from that
                          >>> control?
                          >>>
                          >>> When you have the answers to these questions, come back and we might be
                          >>> able to help you.
                          >>>
                          >>>
                          >>> "KitKat" <kitkat@nospam. com> wrote in message
                          >>> news:OA1UXkyTGH A.5264@TK2MSFTN GP10.phx.gbl...
                          >>>> It is part of the jpg file name that won't change not a folder.
                          >>>> "Cam1-33333335649.jpg " my code will look in the right folder but will
                          >>>> only look for files with Cam1 in the file name, not Cam2, Cam4, Cam6,
                          >>>> Cam7 or Cam8.. I will post more of my code thanks for helping. I
                          >>>> appreciate it very much.
                          >>>>
                          >>>> Private Sub cmbDate_Selecte dIndexChanged(B yVal sender As System.Object,
                          >>>> ByVal e As System.EventArg s) Handles cmbDate.Selecte dIndexChanged
                          >>>>
                          >>>> Try
                          >>>>
                          >>>> Dim dt As DateTime =
                          >>>> DateTime.ParseE xact(cmbDate.It ems(cmbDate.Sel ectedIndex), "MMMM d,
                          >>>> yyyy", Nothing)
                          >>>>
                          >>>> 'loads with the default folder files Cam 1
                          >>>>
                          >>>> Dim path As String = "C:\Projects\Da rryl\Queue Review Files\" &
                          >>>> dt.Month & "-" & dt.Day & "\Cam 1"
                          >>>>
                          >>>> Dim dir As New IO.DirectoryInf o(path)
                          >>>>
                          >>>> Dim files As IO.FileInfo() = dir.GetFiles("* .jpg")
                          >>>>
                          >>>> cmbTime.BeginUp date()
                          >>>>
                          >>>> cmbTime.Items.C lear()
                          >>>>
                          >>>> If files.Length > 0 Then
                          >>>>
                          >>>> cmbTime.Items.A ddRange(files)
                          >>>>
                          >>>> End If
                          >>>>
                          >>>> cmbTime.EndUpda te()
                          >>>>
                          >>>> Catch ex As Exception
                          >>>>
                          >>>> MessageBox.Show (ex.Message, "Error Querying Files",
                          >>>> MessageBoxButto ns.OK, MessageBoxIcon. Error)
                          >>>>
                          >>>> End Try
                          >>>>
                          >>>> End Sub
                          >>>>
                          >>>>
                          >>>>
                          >>>> Public Class ApplicationCont rols
                          >>>>
                          >>>> Public Shared Function FindControl(ByV al owner As Form, ByVal name As
                          >>>> String) As Control
                          >>>>
                          >>>> Dim propInfo As PropertyInfo = _
                          >>>>
                          >>>> owner.GetType() .GetProperty(na me, BindingFlags.Ig noreCase Or _
                          >>>>
                          >>>> BindingFlags.In stance Or BindingFlags.No nPublic Or BindingFlags.Pu blic)
                          >>>>
                          >>>> If Not propInfo Is Nothing Then
                          >>>>
                          >>>> Dim value As Object = propInfo.GetVal ue(owner, Nothing)
                          >>>>
                          >>>> If TypeOf value Is Control Then
                          >>>>
                          >>>> Return value
                          >>>>
                          >>>> End If
                          >>>>
                          >>>> End If
                          >>>>
                          >>>> Return Nothing
                          >>>>
                          >>>> End Function
                          >>>>
                          >>>> End Class
                          >>>>
                          >>>>
                          >>>>
                          >>>>
                          >>>>
                          >>>> Private Sub cmbTime_Selecte dIndexChanged(B yVal sender As System.Object,
                          >>>> ByVal e As System.EventArg s) Handles cmbTime.Selecte dIndexChanged
                          >>>>
                          >>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                          >>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                          >>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                          >>>>
                          >>>> 'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                          >>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                          >>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                          >>>>
                          >>>> For i As Integer = 1 To 8
                          >>>>
                          >>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" &
                          >>>> i)
                          >>>>
                          >>>> If Not pcb Is Nothing Then
                          >>>>
                          >>>> pcb.Image = Image.FromFile( String.Format(f older, i)) <<<errors out
                          >>>> and points here
                          >>>>
                          >>>> 'Else
                          >>>>
                          >>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                          >>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                          >>>>
                          >>>> End If
                          >>>>
                          >>>> Next i
                          >>>>
                          >>>> End Sub
                          >>>>
                          >>>>
                          >>>>
                          >>>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                          >>>> news:OdGVvyvTGH A.5808@TK2MSFTN GP12.phx.gbl...
                          >>>>> So where does the "Cam" prefix in the file name come from.
                          >>>>> The code you posted doesn't show it.
                          >>>>>
                          >>>>> "cmbTime.Te xt" what is this cmbTime object, it sounds like that's
                          >>>>> where the bug is.
                          >>>>>
                          >>>>>
                          >>>>> "KitKat" <kitkat@nospam. com> wrote in message
                          >>>>> news:%23DDDhevT GHA.1868@TK2MSF TNGP09.phx.gbl. ..
                          >>>>>> Thanks Mike for the help!
                          >>>>>>
                          >>>>>> That snippet changes the file name to: C:\Projects\Dar ryl\Queue
                          >>>>>> Review Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg
                          >>>>>>
                          >>>>>> :(
                          >>>>>>
                          >>>>>>
                          >>>>>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                          >>>>>> news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...
                          >>>>>>> What does happen...
                          >>>>>>> I do not see the Format specifier to change the file name...
                          >>>>>>>
                          >>>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                          >>>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                          >>>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                          >>>>>>>
                          >>>>>>> --
                          >>>>>>> mike
                          >>>>>>>
                          >>>>>>> "KitKat" <kitkat@nospam. com> wrote in message
                          >>>>>>> news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...
                          >>>>>>>>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam
                          >>>>>>>>6, Cam 7, and Cam 8. Well it does that but it also needs to change
                          >>>>>>>>the file name to the same folder where the file is being grabbed,
                          >>>>>>>>BUT it doesn't. I have tried and tried.....pleas e help
                          >>>>>>>>
                          >>>>>>>> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                          >>>>>>>> 7\Cam7-20060224170000-01.jpg
                          >>>>>>>>
                          >>>>>>>> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
                          >>>>>>>> name,...:( HELP!
                          >>>>>>>>
                          >>>>>>>>
                          >>>>>>>>
                          >>>>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                          >>>>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                          >>>>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                          >>>>>>>>
                          >>>>>>>> For i As Integer = 1 To 8
                          >>>>>>>>
                          >>>>>>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me,
                          >>>>>>>> "pcbCam" & i)
                          >>>>>>>>
                          >>>>>>>> If Not pcb Is Nothing Then
                          >>>>>>>>
                          >>>>>>>> pcb.Image = Image.FromFile( String.Format(f older, i))
                          >>>>>>>>
                          >>>>>>>> 'Else
                          >>>>>>>>
                          >>>>>>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                          >>>>>>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                          >>>>>>>>
                          >>>>>>>> End If
                          >>>>>>>>
                          >>>>>>>> Next i
                          >>>>>>>>
                          >>>>>>>>
                          >>>>>>>
                          >>>>>>>
                          >>>>>>
                          >>>>>>
                          >>>>>
                          >>>>>
                          >>>>
                          >>>>
                          >>>
                          >>>[/color]
                          >>
                          >>[/color]
                          >
                          >[/color]


                          Comment

                          • KitKat

                            #14
                            Re: DEADLINE! Please help!

                            YES you are right! Perhaps the combo box is keeping that file.

                            Okay.

                            1. User selects from combobox Date "February 24, 2006" which equals the 2-24
                            folder.
                            2. This populates another combo box with files from the default folder,
                            Cam1, so there will be tons of
                            Cam1-20060224165648-01.jpg
                            Cam1-20060224165649-01.jpg
                            Cam1-20060224165650-01.jpg
                            Cam1-20060224165651-01.jpg
                            and so on.

                            So...I need to take that off, like previously said, a split or something?
                            take that off and add what the appropiate folder is like Cam6.

                            I see that must be the problem....can you help me fix this?

                            Thanks so much Stephany, I appreciate your help as well as everyone else
                            here.

                            Thank you for putting up with me.

                            "Stephany Young" <noone@localhos t> wrote in message
                            news:ePAuRF1TGH A.4340@TK2MSFTN GP10.phx.gbl...[color=blue]
                            > No....
                            >
                            > I think that you are misinterpreting the questions.
                            >
                            > You have 2 Comboxes.
                            >
                            > One ComboBox (cmbDate) has some values like "2-24" etc.
                            >
                            > The other ComboBox (cmbTime) has (I suspect) some filenames that you think
                            > are like "2006022416 5649-01.jpg" etc.
                            >
                            > From what you are reporting I suspect that the values in cmbTime actually
                            > have values more like "Cam1-20060224165649-01.jpg" etc.
                            >
                            > Until we know what your exact values are we are shooting in the dark.
                            >
                            >
                            >
                            > "KitKat" <kitkat@nospam. com> wrote in message
                            > news:%23WoNf90T GHA.5464@TK2MSF TNGP10.phx.gbl. ..[color=green]
                            >> Thanks for helping Stephany.
                            >>
                            >> The exception is: FileNotFoundExc eption was unhandled
                            >> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1\Cam
                            >> 1-Cam1-20060224165649-01.jpg
                            >> cannnot be found, that is because the file is actually:
                            >> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                            >> 1\Cam1-20060224165649-01.jpg
                            >>
                            >> String.Format is producing:
                            >> FOLDER:
                            >> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                            >> {0}\Cam1-20060224170000-01.jpg
                            >>
                            >> VALUE: TYPE:
                            >> pcb.Image Nothing System. Drawing.Image
                            >>
                            >> From the combo box cmbTime getting the files associated with the date
                            >> selected in my combo box cmbDate, which defaults to each Cam 1 folder.
                            >> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1
                            >>
                            >> C:\Projects\Dar ryl\Queue Review Files\2-27\Cam 7\
                            >>
                            >> C:\Projects\Dar ryl\Queue Review Files\2-28\Cam 7\
                            >>
                            >> is that what you asked? thanks for helping I am really sorry for the
                            >> hassle.
                            >>
                            >>
                            >>
                            >>
                            >>
                            >>
                            >>
                            >>
                            >>
                            >> "Stephany Young" <noone@localhos t> wrote in message
                            >> news:%237ArU9yT GHA.4492@TK2MSF TNGP09.phx.gbl. ..[color=darkred]
                            >>> The reason anyone not really able to help you is that you are not giving
                            >>> us the full information.
                            >>>
                            >>> You indicate that an exception occurs at the line:
                            >>>
                            >>> pcb.Image = Image.FromFile( String.Format(f older, i))
                            >>>
                            >>> What is the exception?
                            >>>
                            >>> What value is String.Format(f older, i) producing?
                            >>> To find out, try:
                            >>> Console.Writeli ne(String.Forma t(folder, i))
                            >>> at the appropriate point.
                            >>>
                            >>> You also have a ComboBox? (cmbTime) from which you are getting the last
                            >>> part of the filename. What is the value you are getting from that
                            >>> control?
                            >>>
                            >>> When you have the answers to these questions, come back and we might be
                            >>> able to help you.
                            >>>
                            >>>
                            >>> "KitKat" <kitkat@nospam. com> wrote in message
                            >>> news:OA1UXkyTGH A.5264@TK2MSFTN GP10.phx.gbl...
                            >>>> It is part of the jpg file name that won't change not a folder.
                            >>>> "Cam1-33333335649.jpg " my code will look in the right folder but will
                            >>>> only look for files with Cam1 in the file name, not Cam2, Cam4, Cam6,
                            >>>> Cam7 or Cam8.. I will post more of my code thanks for helping. I
                            >>>> appreciate it very much.
                            >>>>
                            >>>> Private Sub cmbDate_Selecte dIndexChanged(B yVal sender As System.Object,
                            >>>> ByVal e As System.EventArg s) Handles cmbDate.Selecte dIndexChanged
                            >>>>
                            >>>> Try
                            >>>>
                            >>>> Dim dt As DateTime =
                            >>>> DateTime.ParseE xact(cmbDate.It ems(cmbDate.Sel ectedIndex), "MMMM d,
                            >>>> yyyy", Nothing)
                            >>>>
                            >>>> 'loads with the default folder files Cam 1
                            >>>>
                            >>>> Dim path As String = "C:\Projects\Da rryl\Queue Review Files\" &
                            >>>> dt.Month & "-" & dt.Day & "\Cam 1"
                            >>>>
                            >>>> Dim dir As New IO.DirectoryInf o(path)
                            >>>>
                            >>>> Dim files As IO.FileInfo() = dir.GetFiles("* .jpg")
                            >>>>
                            >>>> cmbTime.BeginUp date()
                            >>>>
                            >>>> cmbTime.Items.C lear()
                            >>>>
                            >>>> If files.Length > 0 Then
                            >>>>
                            >>>> cmbTime.Items.A ddRange(files)
                            >>>>
                            >>>> End If
                            >>>>
                            >>>> cmbTime.EndUpda te()
                            >>>>
                            >>>> Catch ex As Exception
                            >>>>
                            >>>> MessageBox.Show (ex.Message, "Error Querying Files",
                            >>>> MessageBoxButto ns.OK, MessageBoxIcon. Error)
                            >>>>
                            >>>> End Try
                            >>>>
                            >>>> End Sub
                            >>>>
                            >>>>
                            >>>>
                            >>>> Public Class ApplicationCont rols
                            >>>>
                            >>>> Public Shared Function FindControl(ByV al owner As Form, ByVal name As
                            >>>> String) As Control
                            >>>>
                            >>>> Dim propInfo As PropertyInfo = _
                            >>>>
                            >>>> owner.GetType() .GetProperty(na me, BindingFlags.Ig noreCase Or _
                            >>>>
                            >>>> BindingFlags.In stance Or BindingFlags.No nPublic Or BindingFlags.Pu blic)
                            >>>>
                            >>>> If Not propInfo Is Nothing Then
                            >>>>
                            >>>> Dim value As Object = propInfo.GetVal ue(owner, Nothing)
                            >>>>
                            >>>> If TypeOf value Is Control Then
                            >>>>
                            >>>> Return value
                            >>>>
                            >>>> End If
                            >>>>
                            >>>> End If
                            >>>>
                            >>>> Return Nothing
                            >>>>
                            >>>> End Function
                            >>>>
                            >>>> End Class
                            >>>>
                            >>>>
                            >>>>
                            >>>>
                            >>>>
                            >>>> Private Sub cmbTime_Selecte dIndexChanged(B yVal sender As System.Object,
                            >>>> ByVal e As System.EventArg s) Handles cmbTime.Selecte dIndexChanged
                            >>>>
                            >>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                            >>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                            >>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                            >>>>
                            >>>> 'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                            >>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                            >>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                            >>>>
                            >>>> For i As Integer = 1 To 8
                            >>>>
                            >>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" &
                            >>>> i)
                            >>>>
                            >>>> If Not pcb Is Nothing Then
                            >>>>
                            >>>> pcb.Image = Image.FromFile( String.Format(f older, i)) <<<errors out
                            >>>> and points here
                            >>>>
                            >>>> 'Else
                            >>>>
                            >>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                            >>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                            >>>>
                            >>>> End If
                            >>>>
                            >>>> Next i
                            >>>>
                            >>>> End Sub
                            >>>>
                            >>>>
                            >>>>
                            >>>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                            >>>> news:OdGVvyvTGH A.5808@TK2MSFTN GP12.phx.gbl...
                            >>>>> So where does the "Cam" prefix in the file name come from.
                            >>>>> The code you posted doesn't show it.
                            >>>>>
                            >>>>> "cmbTime.Te xt" what is this cmbTime object, it sounds like that's
                            >>>>> where the bug is.
                            >>>>>
                            >>>>>
                            >>>>> "KitKat" <kitkat@nospam. com> wrote in message
                            >>>>> news:%23DDDhevT GHA.1868@TK2MSF TNGP09.phx.gbl. ..
                            >>>>>> Thanks Mike for the help!
                            >>>>>>
                            >>>>>> That snippet changes the file name to: C:\Projects\Dar ryl\Queue
                            >>>>>> Review Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg
                            >>>>>>
                            >>>>>> :(
                            >>>>>>
                            >>>>>>
                            >>>>>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                            >>>>>> news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...
                            >>>>>>> What does happen...
                            >>>>>>> I do not see the Format specifier to change the file name...
                            >>>>>>>
                            >>>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                            >>>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                            >>>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                            >>>>>>>
                            >>>>>>> --
                            >>>>>>> mike
                            >>>>>>>
                            >>>>>>> "KitKat" <kitkat@nospam. com> wrote in message
                            >>>>>>> news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...
                            >>>>>>>>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam
                            >>>>>>>>6, Cam 7, and Cam 8. Well it does that but it also needs to change
                            >>>>>>>>the file name to the same folder where the file is being grabbed,
                            >>>>>>>>BUT it doesn't. I have tried and tried.....pleas e help
                            >>>>>>>>
                            >>>>>>>> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                            >>>>>>>> 7\Cam7-20060224170000-01.jpg
                            >>>>>>>>
                            >>>>>>>> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
                            >>>>>>>> name,...:( HELP!
                            >>>>>>>>
                            >>>>>>>>
                            >>>>>>>>
                            >>>>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                            >>>>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                            >>>>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                            >>>>>>>>
                            >>>>>>>> For i As Integer = 1 To 8
                            >>>>>>>>
                            >>>>>>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me,
                            >>>>>>>> "pcbCam" & i)
                            >>>>>>>>
                            >>>>>>>> If Not pcb Is Nothing Then
                            >>>>>>>>
                            >>>>>>>> pcb.Image = Image.FromFile( String.Format(f older, i))
                            >>>>>>>>
                            >>>>>>>> 'Else
                            >>>>>>>>
                            >>>>>>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                            >>>>>>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                            >>>>>>>>
                            >>>>>>>> End If
                            >>>>>>>>
                            >>>>>>>> Next i
                            >>>>>>>>
                            >>>>>>>>
                            >>>>>>>
                            >>>>>>>
                            >>>>>>
                            >>>>>>
                            >>>>>
                            >>>>>
                            >>>>
                            >>>>
                            >>>
                            >>>[/color]
                            >>
                            >>[/color]
                            >
                            >[/color]


                            Comment

                            • Stephany Young

                              #15
                              Re: DEADLINE! Please help!

                              So, you are saying that there is a file named Cam2-20060224165648-01.jpg in
                              the Cam2 folder and a file named Cam3-20060224165648-01.jpg in the Cam3
                              folder and a file named Cam4-20060224165648-01.jpg in the Cam4 folder etc.?

                              Or, is the file in the folder called 20060224165648-01.jpg and you are just
                              prepending the 'Cam1-' so you know what cam it belongs to?

                              Does the -01 directly before the extension signify anything? Like the cam
                              number perhaps?



                              "KitKat" <kitkat@nospam. com> wrote in message
                              news:ur4KIL1TGH A.4956@TK2MSFTN GP09.phx.gbl...[color=blue]
                              > YES you are right! Perhaps the combo box is keeping that file.
                              >
                              > Okay.
                              >
                              > 1. User selects from combobox Date "February 24, 2006" which equals the
                              > 2-24 folder.
                              > 2. This populates another combo box with files from the default folder,
                              > Cam1, so there will be tons of
                              > Cam1-20060224165648-01.jpg
                              > Cam1-20060224165649-01.jpg
                              > Cam1-20060224165650-01.jpg
                              > Cam1-20060224165651-01.jpg
                              > and so on.
                              >
                              > So...I need to take that off, like previously said, a split or something?
                              > take that off and add what the appropiate folder is like Cam6.
                              >
                              > I see that must be the problem....can you help me fix this?
                              >
                              > Thanks so much Stephany, I appreciate your help as well as everyone else
                              > here.
                              >
                              > Thank you for putting up with me.
                              >
                              > "Stephany Young" <noone@localhos t> wrote in message
                              > news:ePAuRF1TGH A.4340@TK2MSFTN GP10.phx.gbl...[color=green]
                              >> No....
                              >>
                              >> I think that you are misinterpreting the questions.
                              >>
                              >> You have 2 Comboxes.
                              >>
                              >> One ComboBox (cmbDate) has some values like "2-24" etc.
                              >>
                              >> The other ComboBox (cmbTime) has (I suspect) some filenames that you
                              >> think are like "2006022416 5649-01.jpg" etc.
                              >>
                              >> From what you are reporting I suspect that the values in cmbTime actually
                              >> have values more like "Cam1-20060224165649-01.jpg" etc.
                              >>
                              >> Until we know what your exact values are we are shooting in the dark.
                              >>
                              >>
                              >>
                              >> "KitKat" <kitkat@nospam. com> wrote in message
                              >> news:%23WoNf90T GHA.5464@TK2MSF TNGP10.phx.gbl. ..[color=darkred]
                              >>> Thanks for helping Stephany.
                              >>>
                              >>> The exception is: FileNotFoundExc eption was unhandled
                              >>> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1\Cam
                              >>> 1-Cam1-20060224165649-01.jpg
                              >>> cannnot be found, that is because the file is actually:
                              >>> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                              >>> 1\Cam1-20060224165649-01.jpg
                              >>>
                              >>> String.Format is producing:
                              >>> FOLDER:
                              >>> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                              >>> {0}\Cam1-20060224170000-01.jpg
                              >>>
                              >>> VALUE: TYPE:
                              >>> pcb.Image Nothing System. Drawing.Image
                              >>>
                              >>> From the combo box cmbTime getting the files associated with the date
                              >>> selected in my combo box cmbDate, which defaults to each Cam 1 folder.
                              >>> C:\Projects\Dar ryl\Queue Review Files\2-24\Cam 1
                              >>>
                              >>> C:\Projects\Dar ryl\Queue Review Files\2-27\Cam 7\
                              >>>
                              >>> C:\Projects\Dar ryl\Queue Review Files\2-28\Cam 7\
                              >>>
                              >>> is that what you asked? thanks for helping I am really sorry for the
                              >>> hassle.
                              >>>
                              >>>
                              >>>
                              >>>
                              >>>
                              >>>
                              >>>
                              >>>
                              >>>
                              >>> "Stephany Young" <noone@localhos t> wrote in message
                              >>> news:%237ArU9yT GHA.4492@TK2MSF TNGP09.phx.gbl. ..
                              >>>> The reason anyone not really able to help you is that you are not
                              >>>> giving us the full information.
                              >>>>
                              >>>> You indicate that an exception occurs at the line:
                              >>>>
                              >>>> pcb.Image = Image.FromFile( String.Format(f older, i))
                              >>>>
                              >>>> What is the exception?
                              >>>>
                              >>>> What value is String.Format(f older, i) producing?
                              >>>> To find out, try:
                              >>>> Console.Writeli ne(String.Forma t(folder, i))
                              >>>> at the appropriate point.
                              >>>>
                              >>>> You also have a ComboBox? (cmbTime) from which you are getting the last
                              >>>> part of the filename. What is the value you are getting from that
                              >>>> control?
                              >>>>
                              >>>> When you have the answers to these questions, come back and we might be
                              >>>> able to help you.
                              >>>>
                              >>>>
                              >>>> "KitKat" <kitkat@nospam. com> wrote in message
                              >>>> news:OA1UXkyTGH A.5264@TK2MSFTN GP10.phx.gbl...
                              >>>>> It is part of the jpg file name that won't change not a folder.
                              >>>>> "Cam1-33333335649.jpg " my code will look in the right folder but will
                              >>>>> only look for files with Cam1 in the file name, not Cam2, Cam4, Cam6,
                              >>>>> Cam7 or Cam8.. I will post more of my code thanks for helping. I
                              >>>>> appreciate it very much.
                              >>>>>
                              >>>>> Private Sub cmbDate_Selecte dIndexChanged(B yVal sender As
                              >>>>> System.Object, ByVal e As System.EventArg s) Handles
                              >>>>> cmbDate.Selecte dIndexChanged
                              >>>>>
                              >>>>> Try
                              >>>>>
                              >>>>> Dim dt As DateTime =
                              >>>>> DateTime.ParseE xact(cmbDate.It ems(cmbDate.Sel ectedIndex), "MMMM d,
                              >>>>> yyyy", Nothing)
                              >>>>>
                              >>>>> 'loads with the default folder files Cam 1
                              >>>>>
                              >>>>> Dim path As String = "C:\Projects\Da rryl\Queue Review Files\" &
                              >>>>> dt.Month & "-" & dt.Day & "\Cam 1"
                              >>>>>
                              >>>>> Dim dir As New IO.DirectoryInf o(path)
                              >>>>>
                              >>>>> Dim files As IO.FileInfo() = dir.GetFiles("* .jpg")
                              >>>>>
                              >>>>> cmbTime.BeginUp date()
                              >>>>>
                              >>>>> cmbTime.Items.C lear()
                              >>>>>
                              >>>>> If files.Length > 0 Then
                              >>>>>
                              >>>>> cmbTime.Items.A ddRange(files)
                              >>>>>
                              >>>>> End If
                              >>>>>
                              >>>>> cmbTime.EndUpda te()
                              >>>>>
                              >>>>> Catch ex As Exception
                              >>>>>
                              >>>>> MessageBox.Show (ex.Message, "Error Querying Files",
                              >>>>> MessageBoxButto ns.OK, MessageBoxIcon. Error)
                              >>>>>
                              >>>>> End Try
                              >>>>>
                              >>>>> End Sub
                              >>>>>
                              >>>>>
                              >>>>>
                              >>>>> Public Class ApplicationCont rols
                              >>>>>
                              >>>>> Public Shared Function FindControl(ByV al owner As Form, ByVal name As
                              >>>>> String) As Control
                              >>>>>
                              >>>>> Dim propInfo As PropertyInfo = _
                              >>>>>
                              >>>>> owner.GetType() .GetProperty(na me, BindingFlags.Ig noreCase Or _
                              >>>>>
                              >>>>> BindingFlags.In stance Or BindingFlags.No nPublic Or
                              >>>>> BindingFlags.Pu blic)
                              >>>>>
                              >>>>> If Not propInfo Is Nothing Then
                              >>>>>
                              >>>>> Dim value As Object = propInfo.GetVal ue(owner, Nothing)
                              >>>>>
                              >>>>> If TypeOf value Is Control Then
                              >>>>>
                              >>>>> Return value
                              >>>>>
                              >>>>> End If
                              >>>>>
                              >>>>> End If
                              >>>>>
                              >>>>> Return Nothing
                              >>>>>
                              >>>>> End Function
                              >>>>>
                              >>>>> End Class
                              >>>>>
                              >>>>>
                              >>>>>
                              >>>>>
                              >>>>>
                              >>>>> Private Sub cmbTime_Selecte dIndexChanged(B yVal sender As
                              >>>>> System.Object, ByVal e As System.EventArg s) Handles
                              >>>>> cmbTime.Selecte dIndexChanged
                              >>>>>
                              >>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                              >>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                              >>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                              >>>>>
                              >>>>> 'Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                              >>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                              >>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                              >>>>>
                              >>>>> For i As Integer = 1 To 8
                              >>>>>
                              >>>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me, "pcbCam" &
                              >>>>> i)
                              >>>>>
                              >>>>> If Not pcb Is Nothing Then
                              >>>>>
                              >>>>> pcb.Image = Image.FromFile( String.Format(f older, i)) <<<errors out
                              >>>>> and points here
                              >>>>>
                              >>>>> 'Else
                              >>>>>
                              >>>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                              >>>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                              >>>>>
                              >>>>> End If
                              >>>>>
                              >>>>> Next i
                              >>>>>
                              >>>>> End Sub
                              >>>>>
                              >>>>>
                              >>>>>
                              >>>>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                              >>>>> news:OdGVvyvTGH A.5808@TK2MSFTN GP12.phx.gbl...
                              >>>>>> So where does the "Cam" prefix in the file name come from.
                              >>>>>> The code you posted doesn't show it.
                              >>>>>>
                              >>>>>> "cmbTime.Te xt" what is this cmbTime object, it sounds like that's
                              >>>>>> where the bug is.
                              >>>>>>
                              >>>>>>
                              >>>>>> "KitKat" <kitkat@nospam. com> wrote in message
                              >>>>>> news:%23DDDhevT GHA.1868@TK2MSF TNGP09.phx.gbl. ..
                              >>>>>>> Thanks Mike for the help!
                              >>>>>>>
                              >>>>>>> That snippet changes the file name to: C:\Projects\Dar ryl\Queue
                              >>>>>>> Review Files\2-24\Cam 1\Cam 1-Cam1-20060224165649-01.jpg
                              >>>>>>>
                              >>>>>>> :(
                              >>>>>>>
                              >>>>>>>
                              >>>>>>> "Mike Levine" <nasmaster@REMO VEcomcast.net> wrote in message
                              >>>>>>> news:eQjOvKvTGH A.4384@tk2msftn gp13.phx.gbl...
                              >>>>>>>> What does happen...
                              >>>>>>>> I do not see the Format specifier to change the file name...
                              >>>>>>>>
                              >>>>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                              >>>>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                              >>>>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\Cam {0}-" & cmbTime.Text
                              >>>>>>>>
                              >>>>>>>> --
                              >>>>>>>> mike
                              >>>>>>>>
                              >>>>>>>> "KitKat" <kitkat@nospam. com> wrote in message
                              >>>>>>>> news:%2341$2%23 uTGHA.5264@TK2M SFTNGP10.phx.gb l...
                              >>>>>>>>>I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam
                              >>>>>>>>>6, Cam 7, and Cam 8. Well it does that but it also needs to change
                              >>>>>>>>>the file name to the same folder where the file is being grabbed,
                              >>>>>>>>>BUT it doesn't. I have tried and tried.....pleas e help
                              >>>>>>>>>
                              >>>>>>>>> example: C:\Projects\Dar ryl\Queue Review Files\2-24\Cam
                              >>>>>>>>> 7\Cam7-20060224170000-01.jpg
                              >>>>>>>>>
                              >>>>>>>>> Cam7 but all I keep getting is Cam1, as the beginning of the jpg
                              >>>>>>>>> name,...:( HELP!
                              >>>>>>>>>
                              >>>>>>>>>
                              >>>>>>>>>
                              >>>>>>>>> Dim folder As String = "C:\Projects\Da rryl\Queue Review Files\" &
                              >>>>>>>>> DateTime.ParseE xact(cmbDate.Se lectedItem.ToSt ring, "MMMM d, yyyy",
                              >>>>>>>>> Nothing).ToStri ng("M-d") & "\Cam {0}\" & cmbTime.Text
                              >>>>>>>>>
                              >>>>>>>>> For i As Integer = 1 To 8
                              >>>>>>>>>
                              >>>>>>>>> Dim pcb As PictureBox = ApplicationCont rols.FindContro l(Me,
                              >>>>>>>>> "pcbCam" & i)
                              >>>>>>>>>
                              >>>>>>>>> If Not pcb Is Nothing Then
                              >>>>>>>>>
                              >>>>>>>>> pcb.Image = Image.FromFile( String.Format(f older, i))
                              >>>>>>>>>
                              >>>>>>>>> 'Else
                              >>>>>>>>>
                              >>>>>>>>> ' pcb.Image = Image.FromFile( "C:\Projects\Da rryl\Queue Review
                              >>>>>>>>> Files\2-24\Cam 7\Cam7-20060224170000-01.jpg")
                              >>>>>>>>>
                              >>>>>>>>> End If
                              >>>>>>>>>
                              >>>>>>>>> Next i
                              >>>>>>>>>
                              >>>>>>>>>
                              >>>>>>>>
                              >>>>>>>>
                              >>>>>>>
                              >>>>>>>
                              >>>>>>
                              >>>>>>
                              >>>>>
                              >>>>>
                              >>>>
                              >>>>
                              >>>
                              >>>[/color]
                              >>
                              >>[/color]
                              >
                              >[/color]


                              Comment

                              Working...