I inherited a database that uses Environ() function for the default value in the table definition. This worked fine in 2003 but is not supported in 2007. I know there is a Dev Ashish function but can that function work in the table defintion.
Try putting it on a screen that calls the query and reference Forms!myform!UserID. That works for me when I need to use a variable in a query it can't get too. Also I have a module to pass data called get_global in some queries I filter by populating a global variable then add get_global (userid) the function returns the date. This one function can be used to pass any variable to a query.
Public Function get_global(G_name As String) As Variant
Select Case G_name
Case "UserId"
get_global = Environ("username")
Case "Start_Date"
get_global = gblReportDate
Case "End_Date"
get_global = gblReportDate2
End Select
Thanks for your response. I did my data editing using Dev's function in the forms and it worked fine.
But, it is true in 2003, the ENVIRON() function works in a table def default value field. We had Environ("UserName").
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.