E
efandango
I want to loop through a function call with the code below. But when I run
it, the Function only works on the actual record that I am on within the
form. Is it a Loop problem or something deeper?
Private Sub btn_Runs_Click()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rs As DAO.Recordset
Dim strRun_No As String
Dim lngFN As Long
Dim strFileName As String
lngFN = FreeFile()
strStartRun_No = InputBox("Enter the lower Run No")
strEndRun_No = InputBox("Enter the higher Run No")
strFileName = "Run" & "_" & "Points_" & strStartRun_No & "-" & strEndRun_No
If Len(strStartRun_No) > 0 Then
Set db = CurrentDb()
Set qdf = db.QueryDefs("Generate_KML_Points_Groups")
qdf.Parameters("StartRun") = strStartRun_No
qdf.Parameters("EndRun") = strEndRun_No
Set rs = qdf.OpenRecordset(dbOpenSnapshot)
Do Until rs.EOF = True
rs.MoveNext
Loop
Call YahooAddressLookup(0)
Call sSleep(2000)
rs.Close
End If
Close #lngFN
MsgBox (Done)
End Sub
it, the Function only works on the actual record that I am on within the
form. Is it a Loop problem or something deeper?
Private Sub btn_Runs_Click()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rs As DAO.Recordset
Dim strRun_No As String
Dim lngFN As Long
Dim strFileName As String
lngFN = FreeFile()
strStartRun_No = InputBox("Enter the lower Run No")
strEndRun_No = InputBox("Enter the higher Run No")
strFileName = "Run" & "_" & "Points_" & strStartRun_No & "-" & strEndRun_No
If Len(strStartRun_No) > 0 Then
Set db = CurrentDb()
Set qdf = db.QueryDefs("Generate_KML_Points_Groups")
qdf.Parameters("StartRun") = strStartRun_No
qdf.Parameters("EndRun") = strEndRun_No
Set rs = qdf.OpenRecordset(dbOpenSnapshot)
Do Until rs.EOF = True
rs.MoveNext
Loop
Call YahooAddressLookup(0)
Call sSleep(2000)
rs.Close
End If
Close #lngFN
MsgBox (Done)
End Sub