Drew Wutka
DWUTKA at marlow.com
Fri Jul 11 15:37:50 CDT 2003
I realize you have an If then, I am going to bold what I am talking about, so I'll convert this email to HTML format. > 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 Those two lines, I don't understand why you have them written like that. Do you have line continuations that I don't see, or is the formatting of the email just pushing the lines around? Drew -----Original Message----- From: Nancy Lytle [ mailto:nancy.lytle at auatac.com <mailto:nancy.lytle at auatac.com> ] Sent: Friday, July 11, 2003 2:59 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Function User Log error 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 <http://databaseadvisors.com/mailman/listinfo/accessd> > Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com> > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd <http://databaseadvisors.com/mailman/listinfo/accessd> > Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com> > -- Nancy Lytle EIS nancy.lytle at auatac.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd <http://databaseadvisors.com/mailman/listinfo/accessd> Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030711/3a0e2b95/attachment-0001.html>