 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Working with Login Userforms</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/working-with-login-userforms/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/working-with-login-userforms/</link>
	<description></description>
	<lastBuildDate>Wed, 22 May 2013 12:21:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: mcnitro</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/working-with-login-userforms/#comment-67241</link>
		<dc:creator>mcnitro</dc:creator>
		<pubDate>Fri, 21 Aug 2009 22:14:26 +0000</pubDate>
		<guid isPermaLink="false">#comment-67241</guid>
		<description><![CDATA[PERFECT! That works great! Thank you for your help.  I didn&#039;t consider trying to use the event procedures for the other controls in the userform. Now I can get rid of the extra forms, and the result is not only functional, but aesthetically pleasing as well.

Consider this SOLVED!

Thanks again!]]></description>
		<content:encoded><![CDATA[<p>PERFECT! That works great! Thank you for your help.  I didn&#8217;t consider trying to use the event procedures for the other controls in the userform. Now I can get rid of the extra forms, and the result is not only functional, but aesthetically pleasing as well.</p>
<p>Consider this SOLVED!</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tlsanders1</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/working-with-login-userforms/#comment-67228</link>
		<dc:creator>tlsanders1</dc:creator>
		<pubDate>Fri, 21 Aug 2009 15:32:47 +0000</pubDate>
		<guid isPermaLink="false">#comment-67228</guid>
		<description><![CDATA[I&#039;ve been throwing out ideas without testing them.  This time I tested first.
I think you need to get rid of the For ... Next Loop.  It&#039;s just spinning right through it without stopping.
In Private Sub UserForm_Activate(), I initilize the password counter to 0.
In Private Sub TextBox1_Exit, I set password = TextBox1.Value.
In Private Sub CommandButton1_Click(), first I increment the password counter i = i + 1.
Then in the password test IF...THEN, if the password is not correct, check the counter to see if it has reached 3, and if not then clean out the textbox, TextBox1.Value = &quot;&quot; and set the focus back with         TextBox1.SetFocus.  Then the program can fall through to the end of the CommandButton routine and wait for a new value in TextBox1 and a new click on the CommandButton.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve been throwing out ideas without testing them.  This time I tested first.<br />
I think you need to get rid of the For &#8230; Next Loop.  It&#8217;s just spinning right through it without stopping.<br />
In Private Sub UserForm_Activate(), I initilize the password counter to 0.<br />
In Private Sub TextBox1_Exit, I set password = TextBox1.Value.<br />
In Private Sub CommandButton1_Click(), first I increment the password counter i = i + 1.<br />
Then in the password test IF&#8230;THEN, if the password is not correct, check the counter to see if it has reached 3, and if not then clean out the textbox, TextBox1.Value = &#8220;&#8221; and set the focus back with         TextBox1.SetFocus.  Then the program can fall through to the end of the CommandButton routine and wait for a new value in TextBox1 and a new click on the CommandButton.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mcnitro</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/working-with-login-userforms/#comment-67208</link>
		<dc:creator>mcnitro</dc:creator>
		<pubDate>Thu, 20 Aug 2009 21:43:50 +0000</pubDate>
		<guid isPermaLink="false">#comment-67208</guid>
		<description><![CDATA[I played around with the STOP statment idea, but I couldn&#039;t get that to work either.  The .OnExit statement you refer to doesn&#039;t seem to  be available in Excel 2003 for use with a TextBox.

What I have ended up doing is quite possibly a worse idea than going the InputBox route. I created two new UserForm and wrote the code to cycle through all three as needed.  This helps with the aethetics of my login form, but is also an &quot;ugly&quot; solution!

If anyone can help me to figure this out, I would appreciate it! But for now, the modules are at least working the way I would like them to.]]></description>
		<content:encoded><![CDATA[<p>I played around with the STOP statment idea, but I couldn&#8217;t get that to work either.  The .OnExit statement you refer to doesn&#8217;t seem to  be available in Excel 2003 for use with a TextBox.</p>
<p>What I have ended up doing is quite possibly a worse idea than going the InputBox route. I created two new UserForm and wrote the code to cycle through all three as needed.  This helps with the aethetics of my login form, but is also an &#8220;ugly&#8221; solution!</p>
<p>If anyone can help me to figure this out, I would appreciate it! But for now, the modules are at least working the way I would like them to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tlsanders1</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/working-with-login-userforms/#comment-67180</link>
		<dc:creator>tlsanders1</dc:creator>
		<pubDate>Thu, 20 Aug 2009 15:17:19 +0000</pubDate>
		<guid isPermaLink="false">#comment-67180</guid>
		<description><![CDATA[OK, I think the underlying problem is that when you set the focus back to that TextBox2, there&#039;s nothing to make the program stop running and wait for a new entry.  
You could try adding a Stop statement right after the TextBox2.SetFocus.  Then in TextBox2.OnExit set password = TextBox2.Value again, so that after the new password is typed in and something is done for the TextBox2 to be exited (Enter or Tab), the program can pick back up in the For ... Next loop with the new password.]]></description>
		<content:encoded><![CDATA[<p>OK, I think the underlying problem is that when you set the focus back to that TextBox2, there&#8217;s nothing to make the program stop running and wait for a new entry.<br />
You could try adding a Stop statement right after the TextBox2.SetFocus.  Then in TextBox2.OnExit set password = TextBox2.Value again, so that after the new password is typed in and something is done for the TextBox2 to be exited (Enter or Tab), the program can pick back up in the For &#8230; Next loop with the new password.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mcnitro</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/working-with-login-userforms/#comment-67157</link>
		<dc:creator>mcnitro</dc:creator>
		<pubDate>Wed, 19 Aug 2009 19:56:32 +0000</pubDate>
		<guid isPermaLink="false">#comment-67157</guid>
		<description><![CDATA[I have thought about the InputBox solution, but in my opinion it&#039;s an  &quot;ugly&quot; solution to the problem. There are plenty of login screens out there that allow the user to re-enter the password into the same TextBox they previously used.  Functionality is great, but can&#039;t functionality meet aesthetics??? 

As far as the number of loops, the code works fine for 3 attempts.  The user is allowed to attempt acces when intLogonAttempts is less than 3 (0, 1 or 2), and exits when the variable equals three.]]></description>
		<content:encoded><![CDATA[<p>I have thought about the InputBox solution, but in my opinion it&#8217;s an  &#8220;ugly&#8221; solution to the problem. There are plenty of login screens out there that allow the user to re-enter the password into the same TextBox they previously used.  Functionality is great, but can&#8217;t functionality meet aesthetics??? </p>
<p>As far as the number of loops, the code works fine for 3 attempts.  The user is allowed to attempt acces when intLogonAttempts is less than 3 (0, 1 or 2), and exits when the variable equals three.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mcnitro</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/working-with-login-userforms/#comment-67135</link>
		<dc:creator>mcnitro</dc:creator>
		<pubDate>Wed, 19 Aug 2009 14:20:25 +0000</pubDate>
		<guid isPermaLink="false">#comment-67135</guid>
		<description><![CDATA[Code isn&#039;t very clear in my question.  Thought I would clean it up for you guys/gals.


Private Sub CommandButton1_Click()

UserName = ComboBox1.Value 
Password = TextBox2.Value 
Dim intLogonAttempts As Integer

For intLogonAttempts = 0 To 3          

  &#039;Check to see if data is entered into the username box

If IsNull(UserName) Or UserName = &quot;&quot; Then         
     MsgBox (&quot;User Name is a required field.&quot;)         
     ComboBox1.SetFocus         
     Exit Sub     
End If

  &#039;Check to see if data is entered into the password box

If IsNull(Password) Or Password = &quot;&quot; Then
     MsgBox (&quot;Password is a required field.&quot;)
     TextBox2.SetFocus
     Exit Sub
End If

  &#039;Check to see if  UserName and Password entered match the created variables

If UserName = &quot;Administrator&quot; And Password = &quot;password&quot; Then
     ...Do This...
     ElseIf UserName = &quot;McNitro&quot; And Password =  &quot;password&quot; Then
          ...Do That...
            Else:  MsgBox (&quot;Password Invalid.  Please Try Again&quot;)
            TextBox2.SetFocus
End If           

  &#039;If User Enters incorrect password 3 times database will shutdown

If intLogonAttempts &lt; 3 Then        
    TextBox.Value = &quot;&quot;
    Else: NoAccessQ = MsgBox(&quot;You do not have access to this database.  Please contact your system _
                   administrator.&quot;, vbCritical, &quot;Access is Restricted!&quot;)
               Application.Quit
               Exit Sub
End If

Next intLogonAttempts
End Sub]]></description>
		<content:encoded><![CDATA[<p>Code isn&#8217;t very clear in my question.  Thought I would clean it up for you guys/gals.</p>
<p>Private Sub CommandButton1_Click()</p>
<p>UserName = ComboBox1.Value<br />
Password = TextBox2.Value<br />
Dim intLogonAttempts As Integer</p>
<p>For intLogonAttempts = 0 To 3          </p>
<p>  &#8216;Check to see if data is entered into the username box</p>
<p>If IsNull(UserName) Or UserName = &#8220;&#8221; Then<br />
     MsgBox (&#8220;User Name is a required field.&#8221;)<br />
     ComboBox1.SetFocus<br />
     Exit Sub<br />
End If</p>
<p>  &#8216;Check to see if data is entered into the password box</p>
<p>If IsNull(Password) Or Password = &#8220;&#8221; Then<br />
     MsgBox (&#8220;Password is a required field.&#8221;)<br />
     TextBox2.SetFocus<br />
     Exit Sub<br />
End If</p>
<p>  &#8216;Check to see if  UserName and Password entered match the created variables</p>
<p>If UserName = &#8220;Administrator&#8221; And Password = &#8220;password&#8221; Then<br />
     &#8230;Do This&#8230;<br />
     ElseIf UserName = &#8220;McNitro&#8221; And Password =  &#8220;password&#8221; Then<br />
          &#8230;Do That&#8230;<br />
            Else:  MsgBox (&#8220;Password Invalid.  Please Try Again&#8221;)<br />
            TextBox2.SetFocus<br />
End If           </p>
<p>  &#8216;If User Enters incorrect password 3 times database will shutdown</p>
<p>If intLogonAttempts &lt; 3 Then<br />
    TextBox.Value = &#8220;&#8221;<br />
    Else: NoAccessQ = MsgBox(&#8220;You do not have access to this database.  Please contact your system _<br />
                   administrator.&#8221;, vbCritical, &#8220;Access is Restricted!&#8221;)<br />
               Application.Quit<br />
               Exit Sub<br />
End If</p>
<p>Next intLogonAttempts<br />
End Sub</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/9 queries in 0.014 seconds using memcached
Object Caching 338/341 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-22 13:09:35 -->