S
Stephen Lynch
First thanks for all the help recieved in the past. I have a recordset
linked to a listbox. On the listbox I have the output showing datesonly. For
example, in the table files names are as such:
FileName Path Status
071208.rps C:\test1 Posted
071208.rps C:\test2 Pending
071208.rps C:\test345 Pending
071208.rps C:\test432 Pending
071308.rps C:\test1 Pending
071308.rps C:\test2 Pending
071308.rps C:\test345 Pending
071308.rps C:\test432 Pending
I grouped my List box to show:
071208
071308
What I am trying to do is when I double click the entry like 071208, have
the code loop though each file that starts with the 071208 and has an
extension of rps and staus is Pending .
I have written a few loops before but I am stuck. Here is my lame try at it
for the last hour before asking for help.
My SQL Statement on my Listbox
SELECT Mid([tblImportedFileNames]![FName],3,6) AS FileDate,
tblImportedFileNames.Status
FROM tblImportedFileNames
WHERE (((Right([tblImportedFileNames]![FName],3))="rps"))
GROUP BY Mid([tblImportedFileNames]![FName],3,6),
tblImportedFileNames.Status
HAVING (((tblImportedFileNames.Status)="Pending"))
ORDER BY Mid([tblImportedFileNames]![FName],3,6) DESC;
Code
Private Sub lstboxPost_DblClick(Cancel As Integer)
Dim stFileName As String
Dim stFilePath As String
Dim stFileID As String
'Declare files names as variables
stFileName = Me![lstboxPost].Value
stFilePath = Me![lstboxPost].Column(1)
stFileId = Me![lstboxPost].Column(4)
'Loop through each filename that starts with date
Do Until EOF(stFileName)
'Do something like run sql code to update file'
Loop
Anyway, thanks in advanve.
Steve
linked to a listbox. On the listbox I have the output showing datesonly. For
example, in the table files names are as such:
FileName Path Status
071208.rps C:\test1 Posted
071208.rps C:\test2 Pending
071208.rps C:\test345 Pending
071208.rps C:\test432 Pending
071308.rps C:\test1 Pending
071308.rps C:\test2 Pending
071308.rps C:\test345 Pending
071308.rps C:\test432 Pending
I grouped my List box to show:
071208
071308
What I am trying to do is when I double click the entry like 071208, have
the code loop though each file that starts with the 071208 and has an
extension of rps and staus is Pending .
I have written a few loops before but I am stuck. Here is my lame try at it
for the last hour before asking for help.
My SQL Statement on my Listbox
SELECT Mid([tblImportedFileNames]![FName],3,6) AS FileDate,
tblImportedFileNames.Status
FROM tblImportedFileNames
WHERE (((Right([tblImportedFileNames]![FName],3))="rps"))
GROUP BY Mid([tblImportedFileNames]![FName],3,6),
tblImportedFileNames.Status
HAVING (((tblImportedFileNames.Status)="Pending"))
ORDER BY Mid([tblImportedFileNames]![FName],3,6) DESC;
Code
Private Sub lstboxPost_DblClick(Cancel As Integer)
Dim stFileName As String
Dim stFilePath As String
Dim stFileID As String
'Declare files names as variables
stFileName = Me![lstboxPost].Value
stFilePath = Me![lstboxPost].Column(1)
stFileId = Me![lstboxPost].Column(4)
'Loop through each filename that starts with date
Do Until EOF(stFileName)
'Do something like run sql code to update file'
Loop
Anyway, thanks in advanve.
Steve