Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Last item on a userform

I have multipage userform that has three input items on one page

When I enter a valid number on the last item, it doesn't do anything until I
click somewhere else. When I input a valid number on the other two items,
the logic formats the numbers correctly. How do I get the last field to
format, without clicking the mouse? Code found below -

Sub txbP20_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call FaceLimitCheck(txbP20)
End Sub

Sub txbP30_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call FaceLimitCheck(txbP30)
End Sub

Sub txbP65_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call FaceLimitCheck(txbP65)
End Sub

Sub FaceLimitCheck(Facecheck)
If Not (Facecheck = vbNullString) Then
If Not (IsNumeric(Facecheck)) Then
MsgBox ("Invalid entry please use numbers")
Facecheck.Value = ""
Facecheck.SetFocus
Else
If Facecheck < 25000 Then
MsgBox ("Minimum face amount is 25,000")
Facecheck.Value = ""
Else
Facecheck.Value = Format(Facecheck, "$ #,##0,000")
End If
End If
End If
Call CheckTotalFace
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 236
Default Last item on a userform

When you finish filling the 1st two textboxes, you EXIT the field which kicks
off the 'FaceLimitCheck' procedure.

How does the program know you are finished with the last textbox unless you
click the mouse, double click the mouse, tab out of the field or click out of
the field?
The answer to that question will tell you which method to use if EXIT is not
what you're looking for.

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Brad" wrote:

I have multipage userform that has three input items on one page

When I enter a valid number on the last item, it doesn't do anything until I
click somewhere else. When I input a valid number on the other two items,
the logic formats the numbers correctly. How do I get the last field to
format, without clicking the mouse? Code found below -

Sub txbP20_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call FaceLimitCheck(txbP20)
End Sub

Sub txbP30_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call FaceLimitCheck(txbP30)
End Sub

Sub txbP65_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call FaceLimitCheck(txbP65)
End Sub

Sub FaceLimitCheck(Facecheck)
If Not (Facecheck = vbNullString) Then
If Not (IsNumeric(Facecheck)) Then
MsgBox ("Invalid entry please use numbers")
Facecheck.Value = ""
Facecheck.SetFocus
Else
If Facecheck < 25000 Then
MsgBox ("Minimum face amount is 25,000")
Facecheck.Value = ""
Else
Facecheck.Value = Format(Facecheck, "$ #,##0,000")
End If
End If
End If
Call CheckTotalFace
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Last item on a userform

Gary,

Thanks for your response, but I'm fuzzy on one item.

I agree that by hitting the "enter" key, I exited either the first two
fields which kicks off the 'FaceLimitCheck' procedure - I would like the
"enter" key to work in the same manner for the last textbox as it did for the
first two two textbox.

How did the progam know that by hitting "enter" on the first two textboxes
that I was finished with that field, but it doesn't for the last field?


"Gary Brown" wrote:

When you finish filling the 1st two textboxes, you EXIT the field which kicks
off the 'FaceLimitCheck' procedure.

How does the program know you are finished with the last textbox unless you
click the mouse, double click the mouse, tab out of the field or click out of
the field?
The answer to that question will tell you which method to use if EXIT is not
what you're looking for.

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Brad" wrote:

I have multipage userform that has three input items on one page

When I enter a valid number on the last item, it doesn't do anything until I
click somewhere else. When I input a valid number on the other two items,
the logic formats the numbers correctly. How do I get the last field to
format, without clicking the mouse? Code found below -

Sub txbP20_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call FaceLimitCheck(txbP20)
End Sub

Sub txbP30_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call FaceLimitCheck(txbP30)
End Sub

Sub txbP65_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Call FaceLimitCheck(txbP65)
End Sub

Sub FaceLimitCheck(Facecheck)
If Not (Facecheck = vbNullString) Then
If Not (IsNumeric(Facecheck)) Then
MsgBox ("Invalid entry please use numbers")
Facecheck.Value = ""
Facecheck.SetFocus
Else
If Facecheck < 25000 Then
MsgBox ("Minimum face amount is 25,000")
Facecheck.Value = ""
Else
Facecheck.Value = Format(Facecheck, "$ #,##0,000")
End If
End If
End If
Call CheckTotalFace
End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to ask for a item# and then show all details for that item Durai Excel Discussion (Misc queries) 5 December 4th 09 08:17 PM
To find rate of each item from item.xls and to copy price.xls pol Excel Discussion (Misc queries) 7 July 16th 09 12:49 AM
I need to pair each item on one list to each item on another list Peter R. Excel Worksheet Functions 1 August 24th 07 03:04 AM
Item numbers result in item description in next field in Excel Cheryl MM Excel Worksheet Functions 1 February 20th 07 03:51 PM
Selecting an Item from a List and getting a different item to pop. Matt Excel Worksheet Functions 1 December 7th 04 02:37 PM


All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"