Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Plz help.....Problem in creating a dynamic form


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default Plz help.....Problem in creating a dynamic form

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
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
creating dynamic chart from within VB6 mb Charts and Charting in Excel 1 June 9th 08 05:40 AM
Creating Dynamic Spreadsheets Django Excel Discussion (Misc queries) 4 May 30th 07 06:54 PM
help creating dynamic forms mas Excel Programming 1 March 12th 05 05:21 PM
creating dynamic controls monika Excel Programming 0 April 1st 04 01:56 AM
Dynamic Form Johannes[_2_] Excel Programming 2 September 12th 03 02:16 PM


All times are GMT +1. The time now is 09:15 PM.

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

About Us

"It's about Microsoft Excel"