Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Force minimum text box entry

Hello All,

I have an IsEmpty in my current code that is not working when tied to a
command button to exit the form.

Private Sub CommandButton7_Click()
'determine which button was selected
With AddNew
Select Case True
Case .OptionButton1.Value:
MsgBox "Calculate Repair Only Selected"
Case .OptionButton2.Value:
MsgBox "Calculate & Print Repair Selected"
Case .OptionButton3.Value:
MsgBox "Calculate Repair & Add to Data File Selected"
End Select
End With
If IsEmpty(AddNew.TextBox38.Value) Then
MsgBox "The repair number must be made before proceeding!"
Else

MsgBox "The active cell value is OK"
End If
AddNew.MultiPage1.Value = 1
End Sub

Since this is a tabbed form, will this only work on the complete closure of
the form? It does not make sense.

I also want to verify that the text box entry is numeric 6 digits only. I
have set the text box to Characters 6 in properties, so I know I can't have
more than 6 characters, and I have the numeric validation created, what I am
having a problem is how can I force the user to enter a 6 digit number?

Thanks in advance
JBL


  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Force minimum text box entry

Try this:

Sub MinTextBoxEntry
If Len(Trim$(TextBox1.Text)) <5 Then
'change the number 5 for the minimum text box length
MsgBox("The repair number must be made before
proceeding!")
end if
End Sub


-----Original Message-----
Hello All,

I have an IsEmpty in my current code that is not working

when tied to a
command button to exit the form.

Private Sub CommandButton7_Click()
'determine which button was selected
With AddNew
Select Case True
Case .OptionButton1.Value:
MsgBox "Calculate Repair Only

Selected"
Case .OptionButton2.Value:
MsgBox "Calculate & Print Repair

Selected"
Case .OptionButton3.Value:
MsgBox "Calculate Repair & Add to

Data File Selected"
End Select
End With
If IsEmpty(AddNew.TextBox38.Value) Then
MsgBox "The repair number must be made before

proceeding!"
Else

MsgBox "The active cell value is OK"
End If
AddNew.MultiPage1.Value = 1
End Sub

Since this is a tabbed form, will this only work on the

complete closure of
the form? It does not make sense.

I also want to verify that the text box entry is numeric

6 digits only. I
have set the text box to Characters 6 in properties, so

I know I can't have
more than 6 characters, and I have the numeric

validation created, what I am
having a problem is how can I force the user to enter a

6 digit number?

Thanks in advance
JBL


.

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
Force entry in one cell due to the value in the other WT Excel Worksheet Functions 4 March 30th 10 10:54 PM
Validation - Force entry from drop down list JeffH Excel Discussion (Misc queries) 1 March 11th 09 06:56 PM
Force an entry RKFLattop Excel Discussion (Misc queries) 2 October 16th 06 09:54 PM
Validation to force entry in a cell Matt D Francis Excel Worksheet Functions 4 October 4th 05 02:38 PM
Force entry to one of three cells Martin Smith Excel Worksheet Functions 2 May 27th 05 09:52 AM


All times are GMT +1. The time now is 01:50 PM.

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"