Ok, I'm trying to figure the best way to verify the contents of a folder based on another count via a listbox. Let me further explain.
Here is my current code to count the number of PDFs in two different locations and total them together for a grand total.
'counts test1 pdfs
Dim f As String, c As Long
f = Dir$("\\Test1\PDFs\*.pdf")
Do While Len(f) <> 0
c = c + 1
f = Dir$()
Loop
'counts test2 pdfs
Dim n As String, d As Long
n = Dir$("\\Test2\PDFs\*.pdf")
Do While Len(f) <> 0
d = d + 1
n = Dir$()
Loop
GtotalPDFs = c + d
Here is my current code to count files I've selected in a listbox.
'adds temp1 files
Dim sum1 As Double
For Each item As String In Me.ListBox6.Items
sum1 += Double.Parse(item)
Next
'adds temp2 files
Dim sum2 As Double
For Each item As String In Me.ListBox7.Items
sum2 += Double.Parse(item)
Next
'adds temp3 files
Dim sum3 As Double
For Each item As String In Me.ListBox8.Items
sum3 += Double.Parse(item)
Next
'adds all files together to get a grand total
Gtotal = sum1 + sum2 + sum3
I have another process before this that will create the PDF's based on the files listed in the listbox.
What I am having trouble with is verifying that the PDFs that are created in the Test1 and Test2 folders equal the counts from the listboxes. This count needs to match before running the next process. I'm kind looking for wait or loop until both counts match, again before running the next process.
Any suggestions?