[AccessD] Function User Log error

Nancy Lytle nancy.lytle at auatac.com
Fri Jul 11 14:58:46 CDT 2003


I'm not sure what you mean.  I am building the insert string twice, once to 
insert into "Enter" if the boolean value is one value or else into "Exit" if 
it is not, so the same function logs the user in or out depending on the flag.

Nancy
 
Drew Wutka <DWUTKA at marlow.com> said:

> Why is this in the code twice?
> 
> 'strSQLInsert = strSQLInsert & fcnOSUserName'
> 
> You are saying ""="" & Username
> 
> Why?
> 
> just replace that string with fcnOSUserName, see if that makes a difference.
> 
> Drew
> 
> Any ideas welcome,
> TIA
> Nancy Lytle
> 
> CODE:
> Option Compare Database
> Option Explicit
> Public bolUSERLOG  As Boolean 'enter exit flag
> 
> Public Function fcnLogUser()
> Call fcnOSUserName
> Call fcnUserGroup
> Dim strSQLInsert As String
> MsgBox "User entering/exiting"
> 'DoCmd.SetWarnings False
> If bolUSERLOG = False Then
> strSQLInsert = "insert into tblUserLog(UserName, UserGroup, UserEnter)
> values 
> ('"
> strSQLInsert = strSQLInsert & fcnOSUserName & "', '" & fcnUserGroup & "', #"
> 
> & Now() & "#)"
> MsgBox strSQLInsert
> Else
> strSQLInsert = "insert into tblUserLog(UserName, UserGroup, UserExit) values
> 
> ('"
> strSQLInsert = strSQLInsert & fcnOSUserName & "', '" & fcnUserGroup & "', #"
> 
> & Now() & "#)"
> MsgBox strSQLInsert
> End If
> DoCmd.RunSQL strSQLInsert
> 'DoCmd.SetWarnings True
> End Function
> 
> -- 
> Nancy Lytle
> EIS
> nancy.lytle at auatac.com
> 
> 
> 
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 



-- 
Nancy Lytle
EIS
nancy.lytle at auatac.com





More information about the AccessD mailing list