View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Liedson31 Liedson31 is offline
external usenet poster
 
Posts: 42
Default textboxes problem?

thanks again Bob:
if you remember my previous problem(1.500 textboxes :))) ),let´s say,input
this code into all the textboxes will be a nightmare !!! but it´s the only
solution isn´t it?
what i was askinhg, if is there other solution like format the textbox in
the form open,is there a format property of textbox(like cells format of
excel)...i don´t think so to :). imagine the nightmare i´m going to have to
put this code in all the textboxes .....

the 3) question mean this:
i have a textbox1 and a textbox2...what i want is when i put a value in
textbox1 the textbox2 must have the same value and either to textbox2
input.....
what i want is something like textbox2=textbox1 but the only way o know is
the
Private Sub.... Change()
textbox2=textbox1
end sub

is there a way of making this without write code,i tried in the
controlsource but i can´t do it..in other hand i want to make something like
this to

textbox1,textbox2,textbox3,this textboxes are all in a frame..... and i want
to have a textbox(n) that is the sum of all of them. but in a frame only can
do this with the change event, so if i have 2 frames when i jump into frame2
textbox(n) takes the sum value of all,but if i jump from textbox1 to textbox2
the textbox(n) does´nt take the sum value............

can you help with this 2 problems.....and once more thank you very much Bob


"Bob Phillips" wrote:

1)

Private Sub ZipCode_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer )
With Me.Textbox1
Select Case True
Case (KeyCode = 96 And KeyCode < 105) 'numeric keypad
'exit quietly
Case (KeyCode = 48 And KeyCode < 57) 'normal keypad
'exit quietly
Case KeyCode = 8 'backspace
If Len(.Text) 0 Then
.Text = Left(.Text, Len(.Text) - 1)
End If
KeyCode = 0
Case KeyCode = 46 ' decimal point
Case Else
KeyCode = 0
Beep
End Select
End With
End Sub

2)

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim iPos As Long
With Me.TextBox1
iPos = InStr(1, .Text, ".")
If iPos 0 Then
If iPos < Len(.Text) - 2 Then
MsgBox "Invalid amount"
Cancel = True
End If
End If
End With
End Sub

3) What do you mean by '... without the change event code ...'? Why not just
set it to the other textbox value?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Liedson31" wrote in message
...
hello everyone...
i have a few questions about textboxes and the answer is i suspect

simple...
--by code i know the answer but it´s the only option i have for this?
1) only let the user to insert numbers in a textbox (without code

isnumeric)
2) the textbox must be formated with 2 decimals (without

format(....,"0,00"))
3) 2 textboxes must have the same value so if i input in one of them let´s
say the number 5 the other must list 5(without the change event code)


thanks for any help
Miguel