473,508 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieve date with file for listbox and sort

47 New Member
I am using the following to retrieve a file and put in listbox. It is working fine.
I would like to build on it to include the datecreated of the file and be able to also sort with that date.

Expand|Select|Wrap|Line Numbers
  1.  Const iPath = "C:\patient\scans\Insurance\"
  2.         Dim myInsFile As String
  3.         Dim strPatientId As String
  4.  
  5.         myInsFile = Dir(iPath & strPatientID & "*.*")
  6.  
  7.         lstInsurance.Clear
  8.  
  9.         Do While Not myInsFile = vbNullString
  10.  
  11.              lstInsurance.AddItem myInsFile
  12.              myInsFile = Dir
  13.  
  14.         Loop
  15.  
Thank you for any help
Ken
Feb 28 '08 #1
5 3047
VijaySofist
107 New Member
Hi!

I think you are trying to add the files to the ListBox by getting a FolderName(with path). If this is your criteria means you can use a FileListBox Control instead of a ListBox Control. It will display all the files from your folder path. You can also sort it in Ascending or Descending order.


With Regards
Vijay. R
Feb 28 '08 #2
akirekab
47 New Member
I am not sure how the filelistbox works.
But my objective is to retrieve a set of files with criteria of a number, and only that set of files. It may be one or a dozen files starting with nxxxxx, I would like the file name and date in the list box or file list box if thats possible and in descending order.Then the customer can double click and display the file.

I do not want all the files currently active showing.

I put a file list box in but it showed all current files of the program. Maybe you could give me an example of using the same type of code I have in here, but utilizing a file list box.
Feb 28 '08 #3
Killer42
8,435 Recognized Expert Expert
You might want to try out the ListView control. It allows you to create entries with a number of attributes, which can be viewed as a list, icons and so on, much like Windows Explorer.

Another alternative would be to use a simple grid control, with columns for the pieces of information you're interested in such as name and date.
Feb 29 '08 #4
akirekab
47 New Member
Thnks Killer

First I would like to apologize, I had to leave state, and didnt get back to this till now.

One question on your comment, is the control you reference going to work in VB5 ?

Ken
Mar 6 '08 #5
Killer42
8,435 Recognized Expert Expert
One question on your comment, is the control you reference going to work in VB5 ?
Um... to be honest, I have no idea.

If VB5 doesn't include the Listview control then you may have to track down a copy somewhere. Whether it will actually work, I don't know. But these controls are more or less useable with any language that can use ActiveX controls, aren't they? If someone else here knows more about this sort of compatibility, please let us know.
Mar 6 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

16
2979
by: Daniel Tonks | last post by:
First, please excuse the fact that I'm a complete MySQL newbie. My site used forum software that I wrote myself (in Perl) which, up until now, has used flat files. This worked fine, however...
1
5034
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported...
7
10045
by: 00_ChInkPoIntD12 | last post by:
Can anyone confirm there isn't a Sort() method for WebControl Listbox in Asp.net? It is rather simple to write a method to do the sorting, but just wondering I shouldn't invent the wheel if...
2
1520
by: michele | last post by:
Hi, I want to load a listbox with the date that are stored in a database (mdb), the problem is when I retrieve the date it has a format like "01/01/2006 0.00.00". In Access the date is stored as...
3
4286
by: Kevin Walzer | last post by:
I'm trying to set the active item in a Tkinter listbox to my application's currently-defined default font. Here's how I get the fonts loaded into the listbox: ...
1
4122
by: aRTx | last post by:
<? /* Directory Listing Script - Version 2 ==================================== Script Author: Artani <artan_p@msn.com>. www.artxcenter.com REQUIREMENTS ============ This script requires...
1
3650
by: divya | last post by:
Hello, I used the below code to move selected items between two listboxes Left and Right:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestPopup.aspx.cs" Inherits="TestPopup" %> ...
3
5156
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
7
7124
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
0
7226
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.