macca the hacke
Macca the Hacca
- Local time
- Today, 19:16
- Joined
- Dec 1, 2005
- Messages
- 221
Hi
Probably a really stupid question, but am having one of those days!
I have a function that takes data from a table to be used in queries. This works fine, but I want user to be able to put "(All)" in the table and the query to return all records.
I have tried setting value of function to is not null, but won't let me - keeps saying compile error, syntax error. I have tried different variations, such as setting function value to "", but this returns no records in query.
Below is code:
**code start**
Public Function FilterCompany()
Dim intId As Integer
Dim strFC As String
intId = 1
strFC = CurrentDb.OpenRecordset("select [usys_Tbl_Filters].[portfolio] from [usys_Tbl_Filters] where [usys_Tbl_Filters].[id] = " & intId & "").Fields("portfolio")
If strFC <> "(All)" Then
FilterCompany = strFC
Else
FilterCompany.Value is Not Null
End If
End Function
** code end **
Any help appreciated!
Probably a really stupid question, but am having one of those days!
I have a function that takes data from a table to be used in queries. This works fine, but I want user to be able to put "(All)" in the table and the query to return all records.
I have tried setting value of function to is not null, but won't let me - keeps saying compile error, syntax error. I have tried different variations, such as setting function value to "", but this returns no records in query.
Below is code:
**code start**
Public Function FilterCompany()
Dim intId As Integer
Dim strFC As String
intId = 1
strFC = CurrentDb.OpenRecordset("select [usys_Tbl_Filters].[portfolio] from [usys_Tbl_Filters] where [usys_Tbl_Filters].[id] = " & intId & "").Fields("portfolio")
If strFC <> "(All)" Then
FilterCompany = strFC
Else
FilterCompany.Value is Not Null
End If
End Function
** code end **
Any help appreciated!