I am trying to reference different controls on an access form:
txtCompleteStartDate13 txtCompleteEndDate13
txtCompleteStartDate26 txtCompleteEndDate26
txtCompleteStartDate52 txtCompleteEndDate52
txtCompleteStartDate65 txtCompleteEndDate65
And run the same queries for each set of controls, they are basically different date ranges.
I have everything working fine except the following: I am wanting to use retper (The number in the array) to point me to a different text box on the form. But the variable keeps returning a string instead of the value on the form.
Any ideas? Below is part of the code I am having issues with.
Dim retstart As Date
Dim retend As Date
DoCmd.RunSQL "DELETE FROM TMP_REGION_REPORT_DATA" (Clears Table for input)
retlist = Array("13", "26", "52", "65")
For Each retper In retlist
retstart = "[Forms]![ANNUAL_RETENTION_MAIN_new]![txtCompleteStartDate" & '" & retper & "' & "]"
retend = "[Forms]![ANNUAL_RETENTION_MAIN_new]![txtCompleteEndDate" & '" & retper & "' & "]"
Kevin