I am building an ADP for reporting and have run into some issues passing data from a Form to the report.
I have a combobox on my form named ddlSortBy and it contains 5 choices for the ORDER BY clause of the query, the combobox only has 1 column and that is a string. I am trying to detect which was submitted with a SELECT CASE statement, but it is not working correctly.
If I set a breakpoint at the top of this and run the code, then it runs through without setting the SortBy variable. I have added this line of code,
so that I can see what ddlSortBy is passing. It looks correct, although I'm not sure if there is any whitespace before/after. I did check the ddlSortBy properties and don't see any spaces before/after.
What am I doing wrong?
Thanks,
Drew
I have a combobox on my form named ddlSortBy and it contains 5 choices for the ORDER BY clause of the query, the combobox only has 1 column and that is a string. I am trying to detect which was submitted with a SELECT CASE statement, but it is not working correctly.
Code:
If (Forms!frmEventsByCatRegNoDate.ddlSortBy) <> "" Then
Select Case SortBy
Case "Date (New to Old)"
SortBy = "Date DESC"
Case "Date (Old to New)"
SortBy = "Date ASC"
Case "Register #"
SortBy = "E.RegNo"
Case "Aggressor Register #"
SortBy = "E.AggressorRegNo"
Case "Category"
SortBy = "E.EventCatID"
End Select
End If
If I set a breakpoint at the top of this and run the code, then it runs through without setting the SortBy variable. I have added this line of code,
Code:
MsgBox (Forms!frmEventsByCatRegNoDate.ddlSortBy)
so that I can see what ddlSortBy is passing. It looks correct, although I'm not sure if there is any whitespace before/after. I did check the ddlSortBy properties and don't see any spaces before/after.
What am I doing wrong?
Thanks,
Drew