B
BarryC
I have a user-defined function that I put in a VB module. During the
"Main Menu" form_load event, it fills a Global Variable (uidUser) with
a number that I use to keep track of individual user data in a
multi-user environment.
Here's the code:
Global uidUser As Integer
Public Function UserSession() As Integer
' Used in queries for reports.
UserSession = uidUser
End Function
I call this function in queries like this:
SELECT Prod.UID, Prod.Department, Prod.Pcs
This is embedded in the Datasource for a report. The problem is that
the function either doesn't execute all the time or that it doesn't
return anything.
"Main Menu" form_load event, it fills a Global Variable (uidUser) with
a number that I use to keep track of individual user data in a
multi-user environment.
Here's the code:
Global uidUser As Integer
Public Function UserSession() As Integer
' Used in queries for reports.
UserSession = uidUser
End Function
I call this function in queries like this:
SELECT Prod.UID, Prod.Department, Prod.Pcs
WHERE (((DailyProd_ByDeptDt.UID)=usersession()));From Prod
This is embedded in the Datasource for a report. The problem is that
the function either doesn't execute all the time or that it doesn't
return anything.