Good Evening,
I am trying to construct a subform on a navigation form that pulls in a criteria on an SQL SELECT Statement. I am having a hard time with pulling in "Is Null". I want the query to return based on the username and if the other column is blank (no date entered), then have it sort by another column. Here is the code thus far:
The column with the blank values is called finalreport and I would like it to sort by auditid column.
Any help or suggestions would be greatly appreciated. Thanks!!
I am trying to construct a subform on a navigation form that pulls in a criteria on an SQL SELECT Statement. I am having a hard time with pulling in "Is Null". I want the query to return based on the username and if the other column is blank (no date entered), then have it sort by another column. Here is the code thus far:
Code:
Private Sub Form_Load()
Dim user As String
Dim Task As String
Dim userLevel As String
Dim finalDate As String
finalDate = Nz(finalreport, "")
user = VBA.Environ("UserName")
userLevel = DLookup("[calendarname]", "tbluser", "[login] = '" & user & "'") & ""
Task = "Select * from tblecalendar Where (assigned = '" & userLevel & "' finalreport = finalDate)"
Me.RecordSource = Task
End Sub
The column with the blank values is called finalreport and I would like it to sort by auditid column.
Any help or suggestions would be greatly appreciated. Thanks!!