D
Derek Wittman
Good morning,
I'm working with the fisloaded() function (thanks to the MVPs for their
fantastic site!) to determine a query's criteria. I need to see if the form
is open (obviously). If it is NOT, then I don't want criteria in the query
field. If it is open, I want to check to see what the combobox (cmbdept)
value is. If it's NULL (one of the choices has not been made), I want to
again remove criteria from the query field. If there IS a value in the
cmbdept, I want to use that value for my criteria.
Since the fisloaded() is on the MVP site, I won't bother putting it in here.
Here's my secondary function (fdept) that will be called up in the query's
criteria. Problem is that I cannot get it to compile. And no, I'm not
recent on my use of ifs, thens, and elses.
Thanks in advance for your help!
Function fdept() As String
If fIsLoaded("frmdepartment") = 0 Then
fdept = ""
Else: If Forms!frmdepartment.cmbDept Is Null Then not fdept
Else: fdept = Forms!frmdepartment.cmbDept
End If
End Function
Derek Wittman
I'm working with the fisloaded() function (thanks to the MVPs for their
fantastic site!) to determine a query's criteria. I need to see if the form
is open (obviously). If it is NOT, then I don't want criteria in the query
field. If it is open, I want to check to see what the combobox (cmbdept)
value is. If it's NULL (one of the choices has not been made), I want to
again remove criteria from the query field. If there IS a value in the
cmbdept, I want to use that value for my criteria.
Since the fisloaded() is on the MVP site, I won't bother putting it in here.
Here's my secondary function (fdept) that will be called up in the query's
criteria. Problem is that I cannot get it to compile. And no, I'm not
recent on my use of ifs, thens, and elses.
Thanks in advance for your help!
Function fdept() As String
If fIsLoaded("frmdepartment") = 0 Then
fdept = ""
Else: If Forms!frmdepartment.cmbDept Is Null Then not fdept
Else: fdept = Forms!frmdepartment.cmbDept
End If
End Function
Derek Wittman