Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create textbox/input box

Status
Not open for further replies.

smiler44

Technical User
Sep 18, 2009
83
GB
I came across this code that creates a box with 2 radio buttons on it. The user can choose which button and then pushes
an ok or cancel button. I cannot work out how to adapt it so a textbox/input box is presented so the user can type into the text box and push ok or cancel.
Is it a simple adaptaion or is it more complicated? How do I create an inputbox/textbox for the user to type in to?

thankyou
smiler 44

begin dialog userdialog1 183, 75, "choose" ' 183 = width of dialog box, 75 = height of dialog box
groupbox 5, 4, 97, 47, ""
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, "1st", .optionbutton1 '116 position from left,16 position from top, 46 width of label, 12 not sure height of label perhaps
optionbutton 16, 30, 67, 8, "2nd", .optionbbutton2
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog

dim mydialog1 as userdialog1
on error resume next
dialog mydialog1
if err=102 then
msgbox"macro ended"
end if

sasopt = mydialog1.optiongroup1
if sasopt = 0 then
msgbox "zero"
else
if sasopt = 1 then
msgbox "1"
end if
end if
 
thankyou remy998 I will try that code

smiler44
 

maybe something like this would work for you?

Code:
Sub Main
    
    Default = "Hello"
    
    UserInput = InputBox ("Please Input Something",Default,Default)
    
    msgbox Ucase(UserInput)
    
End Sub

i something use this when i don't want to use a dialog box
 
thankyou remy988. I will make a note of they way you have shown me but I have cheated. I no longer have the user input the word they want to search for into a text box but have them type it on to the "command line" at the top left of the Attachmate screen.
my code then reads it and searches.

thanks again
smiler44
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top