S
Stephen
Hi Folks,
In my solution I'm asking for a user to input two parameters that are
strings that I am then passing to an SQL query. Everything works great but I
don't think I am properly or efficiently checking that the parameters are not
either blank or mis formatted. Any suggestions are always greatly appreciated.
' Ask for Data Range Input
dtStartDate = InputBox("Enter a starting date for the report range.",
"Beginning Date Range", "XX/XX/XXXX")
dtEndDate = InputBox("Enter an end date for the report range.", "Ending Date
Range.", "XX/XX/XXXX")
' Check to make sure there has been data entered for the report dates
Do While dtStartDate = ("XX/XX/XXXX")
dtStartDate = InputBox("You must enter a start date for the report
range.", "Beginning Date Range", "XX/XX/XXXX")
Loop
Do While dtStartDate = ("")
dtStartDate = InputBox("You must enter a start date for the report
range.", "Beginning Date Range", "XX/XX/XXXX")
Loop
Do While dtEndDate = ("XX/XX/XXXX")
dtEndDate = InputBox("You must enter an end date for the report range.",
"Ending Date Range", "XX/XX/XXXX")
Loop
Do While dtEndDate = ("")
dtEndDate = InputBox("You must enter an end date for the report range.",
"Ending Date Range", "XX/XX/XXXX")
Loop
Thanks.
In my solution I'm asking for a user to input two parameters that are
strings that I am then passing to an SQL query. Everything works great but I
don't think I am properly or efficiently checking that the parameters are not
either blank or mis formatted. Any suggestions are always greatly appreciated.
' Ask for Data Range Input
dtStartDate = InputBox("Enter a starting date for the report range.",
"Beginning Date Range", "XX/XX/XXXX")
dtEndDate = InputBox("Enter an end date for the report range.", "Ending Date
Range.", "XX/XX/XXXX")
' Check to make sure there has been data entered for the report dates
Do While dtStartDate = ("XX/XX/XXXX")
dtStartDate = InputBox("You must enter a start date for the report
range.", "Beginning Date Range", "XX/XX/XXXX")
Loop
Do While dtStartDate = ("")
dtStartDate = InputBox("You must enter a start date for the report
range.", "Beginning Date Range", "XX/XX/XXXX")
Loop
Do While dtEndDate = ("XX/XX/XXXX")
dtEndDate = InputBox("You must enter an end date for the report range.",
"Ending Date Range", "XX/XX/XXXX")
Loop
Do While dtEndDate = ("")
dtEndDate = InputBox("You must enter an end date for the report range.",
"Ending Date Range", "XX/XX/XXXX")
Loop
Thanks.