Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default getting textbox value

Hi

I am tryign to add dynamic textbox (I am successful...with
the feedback i got from this superb usergrp).
But i am unable to check for its value...i have done a lot
of modification with the code below.. its gives an error
at:
For Each newButton In Me.Controls

any help?
thanks...

Public newButton As MSForms.Control
Private Sub UserForm_Initialize()

numOfSheets = 4
z = 18
If numOfSheets 4 Then frmAddMoreSheets.Height = 300
For i = 1 To numOfSheets
Set newButton = Me.Controls.Add
("Forms.Textbox.1", "txtBox")
newButton.Name = "Textbox" & i
z = z + 30
With newButton
.Left = 18
.Top = z
.Visible = True
End With

Next i
'Unload Me
End Sub
Private Sub CommandButton1_Click()
For i = 1 To numOfSheets
'If TextBox & i.Value = "" Then MsgBox "emptu"
Next i
For Each newButton In Me.Controls
With newButton

If .Value = "" Then MsgBox "empty"
End With
Next newButton

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default getting textbox value

I resolved this...as I found a wonderful article on
dynamic forms. Though Bob had given a lead in my
yesterday's post... but this one actually shows you how to
refer the value's.

http://pubs.logicalexpressions.com/P...PMArticle.asp?
ID=259
-----Original Message-----
Hi

I am tryign to add dynamic textbox (I am

successful...with
the feedback i got from this superb usergrp).
But i am unable to check for its value...i have done a

lot
of modification with the code below.. its gives an error
at:
For Each newButton In Me.Controls

any help?
thanks...

Public newButton As MSForms.Control
Private Sub UserForm_Initialize()

numOfSheets = 4
z = 18
If numOfSheets 4 Then frmAddMoreSheets.Height = 300
For i = 1 To numOfSheets
Set newButton = Me.Controls.Add
("Forms.Textbox.1", "txtBox")
newButton.Name = "Textbox" & i
z = z + 30
With newButton
.Left = 18
.Top = z
.Visible = True
End With

Next i
'Unload Me
End Sub
Private Sub CommandButton1_Click()
For i = 1 To numOfSheets
'If TextBox & i.Value = "" Then MsgBox "emptu"
Next i
For Each newButton In Me.Controls
With newButton

If .Value = "" Then MsgBox "empty"
End With
Next newButton

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
Calculate Textbox value based on another textbox value.doc Tdungate Excel Discussion (Misc queries) 1 February 12th 09 07:11 PM
Calculate Textbox value based on another textbox value Tdungate Excel Discussion (Misc queries) 0 February 12th 09 07:03 PM
Textbox to Textbox Troubled User Excel Discussion (Misc queries) 1 April 13th 07 03:44 AM
TextBox grahammal Excel Discussion (Misc queries) 1 April 10th 06 05:41 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 01:55 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"