VBA Help on Loop

  • Thread starter Thread starter JasonC
  • Start date Start date
J

JasonC

Hi All-

I am pulling my hair out on this problem that I am having. I have a
list of employees in a table connected to the form and when u click on
the form where the employee is it will take u to a different website
with that employees information. How can I get it to loop through each
one vs clicking each employee to see the data. How can I get it to
loop through each employee in the tracking list

Here is the code so far

I need this to loop through each employee in the tracking list and
wait about 10 seconds while I copy whats on the website for that
employee.

Private Sub TrackingList_Click()
Forms!frmDashBoard_SEAS!TrackNum = TrackingList.Column(3)
Call Forms("frmDashBoard_SEAS").run_Click
End Sub

2nd part of code where it calls the run_Click

Public Sub run_Click()
On Error Resume Next
WebBrowser1.navigate "http://psr-anc-cluster.lhsprod.fedex.com/
report/
ear_master.psp?emp=" & Me.TrackNum & "&start_date=" & Format(Nz
([Forms]![frmDashBoard_SEAS]![DT]), "mm/dd") & "&start_time=00:00" &
"&end_date=" & Format(Nz([Forms]![frmDashBoard_SEAS]![DT]), "mm/dd") &
"&end_time=23:59&action_view=View"
End Sub
 
You could populate a recordset using RecordSetClone, then use a Do loop to
step through each record. There isn't a sleep function, but maybe a msgbox
to continue, or a dummy loop with DoEvents to force a pause.
 
Back
Top