Continous Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • questionit
    Contributor
    • Feb 2007
    • 553

    Continous Form

    Hi

    I know how to implement Continous form. In the method i have tried, the source for data on the continous form comes from table using SQL query

    Now, i want to try something different and i need your help.

    With the same continous form, i want the source for the data to be a simple piece of code that returns names of files in the folder.

    I have completed working code for getting file names in the folder:

    [code=vb]
    Dim fs
    Set fs = Application.Fil eSearch
    With fs
    .LookIn = "c:\abc"
    .FileName = "*.doc"
    .searchsubfolde rs = False
    fs.Execute

    For j = 1 To .Foundfiles.Cou nt
    MsgBox .Foundfiles(j)
    ' --------- Me.subf.Form.Re cordSource = .Foundfiles(j) -- how to do this thing? ---
    Next j
    End With
    [/code]

    There is no problem with that. Now please help me in displaying the result of the above code (returned using .FoundFiles(j) )
    on the continous form.. How to go about doing this?

    Awaiting your responce

    Thanks
    qi
  • MikeTheBike
    Recognized Expert Contributor
    • Jun 2007
    • 640

    #2
    Originally posted by questionit
    Hi

    I know how to implement Continous form. In the method i have tried, the source for data on the continous form comes from table using SQL query

    Now, i want to try something different and i need your help.

    With the same continous form, i want the source for the data to be a simple piece of code that returns names of files in the folder.

    I have completed working code for getting file names in the folder:

    [code=vb]
    Dim fs
    Set fs = Application.Fil eSearch
    With fs
    .LookIn = "c:\abc"
    .FileName = "*.doc"
    .searchsubfolde rs = False
    fs.Execute

    For j = 1 To .Foundfiles.Cou nt

    ' --------- Me.subf.Form.Re cordSource = .Foundfiles(j) -- how to do this thing? ---
    Next j
    End With
    [/code]

    There is no problem with that. Now please help me in displaying the result of the above code (returned using .FoundFiles(j) )
    on the continous form.. How to go about doing this?

    Awaiting your responce

    Thanks
    qi
    Hi

    Why do you want to display then in a continuous form?

    It would be pretty simple to display them in a list box !?

    Code:
    With fs
        .LookIn = "c:\abc"
        .FileName = "*.doc"
        .searchsubfolders = False
        fs.Execute
    
        Dim strSource as String
        strSource = ";"
        For j = 1 To .Foundfiles.Count
            strSource =  & strSource & ";" & .Foundfiles(j)
        Next j 
    End With
    
    List1.RowSourceType = "Value List"
    List1.RowSource = Mid(strSource,2)      '--Mid()  Remove leading ';'
    ??

    MTB

    Comment

    • questionit
      Contributor
      • Feb 2007
      • 553

      #3
      Thanks a lot for this suggestion MTB.

      It would be more easily readable the list on a Continous Form instead.

      Could you please guide me if this could be done.

      Perhaps, save the returned values into a table then query the table to assign its result to the Continous Form -this should work but is a lengthy way though!

      Let me know any solutions for this

      Thanks
      Qi

      Originally posted by MikeTheBike
      Hi

      Why do you want to display then in a continuous form?

      It would be pretty simple to display them in a list box !?

      Code:
      With fs
          .LookIn = "c:\abc"
          .FileName = "*.doc"
          .searchsubfolders = False
          fs.Execute
      
          Dim strSource as String
          strSource = ";"
          For j = 1 To .Foundfiles.Count
              strSource =  & strSource & ";" & .Foundfiles(j)
          Next j 
      End With
      
      List1.RowSourceType = "Value List"
      List1.RowSource = Mid(strSource,2)      '--Mid()  Remove leading ';'
      ??

      MTB

      Comment

      Working...