<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE></TITLE>
<META content="MSHTML 6.00.2722.900" name=GENERATOR></HEAD>
<BODY>
<P><FONT size=2>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.<BR><BR>> If
bolUSERLOG = False Then<BR>> strSQLInsert = "insert into tblUserLog(UserName,
UserGroup, UserEnter)<BR>> values<BR>> ('"<BR>> <STRONG><U>strSQLInsert
= strSQLInsert & fcnOSUserName</U></STRONG> & "', '" & fcnUserGroup
& "', #"<BR>><BR>> & Now() & "#)"<BR>> MsgBox
strSQLInsert<BR>> Else<BR>> strSQLInsert = "insert into
tblUserLog(UserName, UserGroup, UserExit) values<BR>><BR>> ('"<BR>>
<STRONG><U>strSQLInsert = strSQLInsert & fcnOSUserName</U></STRONG> &
"', '" & fcnUserGroup & "', #"<BR>><BR>> & Now() &
"#)"<BR>> MsgBox strSQLInsert<BR>> End If<BR></FONT></P>
<P><FONT size=2>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?</FONT></P>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial color=#0000ff>Drew</FONT></DIV>
<P><BR>-----Original Message-----<BR>From: Nancy Lytle [<A
href="mailto:nancy.lytle@auatac.com">mailto:nancy.lytle@auatac.com</A>]<BR>Sent:
Friday, July 11, 2003 2:59 PM<BR>To: Access Developers discussion and problem
solving<BR>Subject: RE: [AccessD] Function User Log error<BR><BR><BR><BR>I'm not
sure what you mean. I am building the insert string twice, once
to<BR>insert into "Enter" if the boolean value is one value or else into "Exit"
if<BR>it is not, so the same function logs the user in or out depending on the
flag.<BR><BR>Nancy<BR><BR>Drew Wutka <DWUTKA@marlow.com> said:<BR><BR>>
Why is this in the code twice?<BR>><BR>> 'strSQLInsert = strSQLInsert
& fcnOSUserName'<BR>><BR>> You are saying ""="" &
Username<BR>><BR>> Why?<BR>><BR>> just replace that string with
fcnOSUserName, see if that makes a difference.<BR>><BR>>
Drew<BR>><BR>> Any ideas welcome,<BR>> TIA<BR>> Nancy
Lytle<BR>><BR>> CODE:<BR>> Option Compare Database<BR>> Option
Explicit<BR>> Public bolUSERLOG As Boolean 'enter exit
flag<BR>><BR>> Public Function fcnLogUser()<BR>> Call
fcnOSUserName<BR>> Call fcnUserGroup<BR>> Dim strSQLInsert As
String<BR>> MsgBox "User entering/exiting"<BR>> 'DoCmd.SetWarnings
False<BR>> If bolUSERLOG = False Then<BR>> strSQLInsert = "insert into
tblUserLog(UserName, UserGroup, UserEnter)<BR>> values<BR>> ('"<BR>>
strSQLInsert = strSQLInsert & fcnOSUserName & "', '" & fcnUserGroup
& "', #"<BR>><BR>> & Now() & "#)"<BR>> MsgBox
strSQLInsert<BR>> Else<BR>> strSQLInsert = "insert into
tblUserLog(UserName, UserGroup, UserExit) values<BR>><BR>> ('"<BR>>
strSQLInsert = strSQLInsert & fcnOSUserName & "', '" & fcnUserGroup
& "', #"<BR>><BR>> & Now() & "#)"<BR>> MsgBox
strSQLInsert<BR>> End If<BR>> DoCmd.RunSQL strSQLInsert<BR>>
'DoCmd.SetWarnings True<BR>> End Function<BR>><BR>> --<BR>> Nancy
Lytle<BR>> EIS<BR>>
nancy.lytle@auatac.com<BR>><BR>><BR>><BR>><BR>>
_______________________________________________<BR>> AccessD mailing
list<BR>> AccessD@databaseadvisors.com<BR>> <A
href="http://databaseadvisors.com/mailman/listinfo/accessd"
target=_blank>http://databaseadvisors.com/mailman/listinfo/accessd</A><BR>>
Website: <A href="http://www.databaseadvisors.com"
target=_blank>http://www.databaseadvisors.com</A><BR>>
_______________________________________________<BR>> AccessD mailing
list<BR>> AccessD@databaseadvisors.com<BR>> <A
href="http://databaseadvisors.com/mailman/listinfo/accessd"
target=_blank>http://databaseadvisors.com/mailman/listinfo/accessd</A><BR>>
Website: <A href="http://www.databaseadvisors.com"
target=_blank>http://www.databaseadvisors.com</A><BR>><BR><BR><BR><BR>--<BR>Nancy
Lytle<BR>EIS<BR>nancy.lytle@auatac.com<BR><BR><BR><BR>_______________________________________________<BR>AccessD
mailing list<BR>AccessD@databaseadvisors.com<BR><A
href="http://databaseadvisors.com/mailman/listinfo/accessd"
target=_blank>http://databaseadvisors.com/mailman/listinfo/accessd</A><BR>Website:
<A href="http://www.databaseadvisors.com"
target=_blank>http://www.databaseadvisors.com</A><BR></P></FONT></BODY></HTML>