D Loop Not working

brucey54

Registered User.
Local time
Today, 01:14
Joined
Jun 18, 2012
Messages
155
Hi, could someone point out where I'm going wrong with this loop, trying to run Update query number of times, is this possible??

Private Sub Command38_Click()

Dim startDate As Date, endDate As Date
Dim tempvalue As Long, dayCtr As Long

startDate = InputBox("Enter the Start Date")

endDate = InputBox("Enter the End Date")

dayCtr = DateDiff("d", startDate, endDate)

Do

DoCmd.OpenQuery "Qry_04_ReOrderDietPlan", acViewNormal, acEdit

tempvalue + = 1


Loop Until tempvalue = dayCtr

End Sub
 
tempvalue = tempvalue + 1
 

Users who are viewing this thread

Back
Top Bottom