Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I wanted to create a dynamic form as follows. 1) I ask the user to enter the required number 2) User enteres a number. for ex: 3 3) A form should genarate as Enter Employee 1 name: ".....Edit field....." Enter Employee 2 name: ".....Edit field....." Enter Employee 3 name: ".....Edit field....." The form should grow dynamically depending on the user input value. I tried this with creating a custom command bar and I succeeded creating dynamic Edit fields, but I didnt kow how to include the text "Enter Employee 1 name" before the Edit field. Please advice me how to include the text. -- shashi1515 ------------------------------------------------------------------------ shashi1515's Profile: http://www.excelforum.com/member.php...o&userid=31109 View this thread: http://www.excelforum.com/showthread...hreadid=512742 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like the following should do it:
Dim objLabel As Control, objTextbox As Control, i As Integer For i = 1 To iNumberToCreate Set objLabel = Me.Controls.Add("Forms.Label.1", "myLabel_" & i, True) With objLabel .Caption = "Enter Employee " & i & " name:" .Top = 20 + i * 20 ' <<< set its position on the form .Left = 10 .Width = 120 .Font.Bold = True ' or whatever you want.. End With Set objTextbox = Me.Controls.Add("Forms.Textbox.1", "myTextBox_" & i, True) With objTextbox .Top = 20 + i * 20 ' <<< set its position on the form .Left = objLabel.Left + objLabel.Width + 10 .Width = 100 End With Next shashi1515 wrote: I wanted to create a dynamic form as follows. 1) I ask the user to enter the required number 2) User enteres a number. for ex: 3 3) A form should genarate as Enter Employee 1 name: ".....Edit field....." Enter Employee 2 name: ".....Edit field....." Enter Employee 3 name: ".....Edit field....." The form should grow dynamically depending on the user input value. I tried this with creating a custom command bar and I succeeded creating dynamic Edit fields, but I didnt kow how to include the text "Enter Employee 1 name" before the Edit field. Please advice me how to include the text. -- shashi1515 ------------------------------------------------------------------------ shashi1515's Profile: http://www.excelforum.com/member.php...o&userid=31109 View this thread: http://www.excelforum.com/showthread...hreadid=512742 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
creating dynamic chart from within VB6 | Charts and Charting in Excel | |||
Creating Dynamic Spreadsheets | Excel Discussion (Misc queries) | |||
help creating dynamic forms | Excel Programming | |||
creating dynamic controls | Excel Programming | |||
Dynamic Form | Excel Programming |