B
bgcpen
Hello all, i have the function below trying to open a recordset based on a
query.
The problem i am having is setting userName = (rs![Expr3])
Expr 3 is an expression field in the query. I am getting a
"Run-time error '3265'; Item not found in this collection."
When i look in the locals window of the program, i see that the recordset
does not contain the Expr3 or any other expression field. How can i get it so
that the expression field will be accessible to the VBA program?
Thanks!
Function Main()
Const strqryName = "servicemom_alerts"
Dim userAlias As String
Dim userName As String
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset(strqryName)
userName = (rs![Expr3])
Call sbSendMessage(userAlias, userName)
fullname = userAlias
Main = fullname
End Function
query.
The problem i am having is setting userName = (rs![Expr3])
Expr 3 is an expression field in the query. I am getting a
"Run-time error '3265'; Item not found in this collection."
When i look in the locals window of the program, i see that the recordset
does not contain the Expr3 or any other expression field. How can i get it so
that the expression field will be accessible to the VBA program?
Thanks!
Function Main()
Const strqryName = "servicemom_alerts"
Dim userAlias As String
Dim userName As String
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset(strqryName)
userName = (rs![Expr3])
Call sbSendMessage(userAlias, userName)
fullname = userAlias
Main = fullname
End Function