D
dgmoore
This is an easy one, but not something I work with very much. I need to
use the value returned by a function in a query, but am encountering an
error.
Function GetIDs()
Dim db As Database
Dim IDs As Recordset
Dim strIDs As String
Set db = CurrentDb()
Set IDs = db.OpenRecordset("tbl_x")
....[loop through table and generate strIDs]...
GetIDs = strIDs
Here I get error 'Expected function or variable'.
I have an (apparently) analogous function that works fine:
Public PageDate As Date
Function GetDate()
If PageDate = "12:00:00 AM" Then
GetDate = Format(Date, "mm/dd/yy")
Else
GetDate = PageDate
End If
I'm not seeing where the function that works is different from the one
that doesn't. Could somebody point out the error of my ways?
Thanks
Dave
use the value returned by a function in a query, but am encountering an
error.
Function GetIDs()
Dim db As Database
Dim IDs As Recordset
Dim strIDs As String
Set db = CurrentDb()
Set IDs = db.OpenRecordset("tbl_x")
....[loop through table and generate strIDs]...
GetIDs = strIDs
Here I get error 'Expected function or variable'.
I have an (apparently) analogous function that works fine:
Public PageDate As Date
Function GetDate()
If PageDate = "12:00:00 AM" Then
GetDate = Format(Date, "mm/dd/yy")
Else
GetDate = PageDate
End If
I'm not seeing where the function that works is different from the one
that doesn't. Could somebody point out the error of my ways?
Thanks
Dave