Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

Continous Form

Question posted by: questionit (Site Addict) on July 24th, 2008 06:51 PM
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:

Expand|Select|Wrap|Line Numbers
  1. Dim fs
  2. Set fs = Application.FileSearch
  3. With fs
  4. .LookIn = "c:\abc"
  5. .FileName = "*.doc"
  6. .searchsubfolders = False
  7. fs.Execute
  8.  
  9. For j = 1 To .Foundfiles.Count
  10. MsgBox .Foundfiles(j)
  11. ' --------- Me.subf.Form.RecordSource = .Foundfiles(j)   -- how to do this thing? ---
  12. Next j
  13. End With


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's Avatar
MikeTheBike
Expert
269 Posts
July 25th, 2008
12:08 PM
#2

Re: Continous Form
Quote:
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:

Expand|Select|Wrap|Line Numbers
  1. Dim fs
  2. Set fs = Application.FileSearch
  3. With fs
  4.     .LookIn = "c:\abc"
  5.     .FileName = "*.doc"
  6.     .searchsubfolders = False
  7.     fs.Execute
  8.  
  9.     For j = 1 To .Foundfiles.Count
  10.  
  11.         ' --------- Me.subf.Form.RecordSource = .Foundfiles(j)   -- how to do this thing? ---
  12.     Next j
  13. End With


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 !?

Expand|Select|Wrap|Line Numbers
  1. With fs
  2.     .LookIn = "c:\abc"
  3.     .FileName = "*.doc"
  4.     .searchsubfolders = False
  5.     fs.Execute
  6.  
  7.     Dim strSource as String
  8.     strSource = ";"
  9.     For j = 1 To .Foundfiles.Count
  10.         strSource =  & strSource & ";" & .Foundfiles(j)
  11.     Next j 
  12. End With
  13.  
  14. List1.RowSourceType = "Value List"
  15. List1.RowSource = Mid(strSource,2)      '--Mid()  Remove leading ';'


??

MTB

Reply
questionit's Avatar
questionit
Site Addict
519 Posts
July 25th, 2008
04:59 PM
#3

Re: Continous Form
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

Quote:
Hi

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

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

Expand|Select|Wrap|Line Numbers
  1. With fs
  2.     .LookIn = "c:\abc"
  3.     .FileName = "*.doc"
  4.     .searchsubfolders = False
  5.     fs.Execute
  6.  
  7.     Dim strSource as String
  8.     strSource = ";"
  9.     For j = 1 To .Foundfiles.Count
  10.         strSource =  & strSource & ";" & .Foundfiles(j)
  11.     Next j 
  12. End With
  13.  
  14. List1.RowSourceType = "Value List"
  15. List1.RowSource = Mid(strSource,2)      '--Mid()  Remove leading ';'


??

MTB

Reply
Reply
Not the answer you were looking for? Post your question . . .
190,079 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Microsoft Access / VBA Forum Contributors