473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

input boxes

lee123
556 512MB
here's a question, how can i use an input box to enter information in a listbox,
example: lets say i wanted to use a command button to get a inputbox that askes "enter your name" so i would type my name then when i click ok i would like it to be entered in an list box. sorta like transfer my name into the listbox can this be done? and whats the code for doing this or how would i do this

lee123
Jul 22 '07 #1
5 1044
lee123
556 512MB
oh i forgot to add address and phone# so now i would like to know how i can put all of these things in an input box to add in a "label" instead of an listbox so when they press the button it would prompt them to add an name then a address then a phone number
Jul 22 '07 #2
Killer42
8,435 Expert 8TB
oh i forgot to add address and phone# so now i would like to know how i can put all of these things in an input box to add in a "label" instead of an listbox so when they press the button it would prompt them to add an name then a address then a phone number
You haven't said what version of VB you're using, so for now I'll assume VB6 (because it's the version I'm familiar with).

The simplest way would be to use the InputBox() function. This is a pretty ugly function, but it does the job. You can improve the look once you've got a better idea of how to go about it.

The general technique would be to drop a command button on the form, and in the Click event procedure for the button, add something like...
Expand|Select|Wrap|Line Numbers
  1. Dim Answer As String
  2. Answer = InputBox("Enter your name", "Some window title")
  3. List1.AddItem Answer
  4.  
Of course, to handle more than one input you can just call the InputBox() function multiple times, to prompt for one after another. But ideally you would want to create your own form with textboxes to accept the name and so on, then just show that. This is one area where VB versions vary quite a bit.
Jul 22 '07 #3
lee123
556 512MB
well thanks for the tips, it worked but see how i have that im stuck on something else the reason why i asked that question is that the order form im trying to build isn't working at all i have the button on the form that when i press it the input box askes for the name....and so on and it puts it in the label just like i wanted it to but i have also placed four txtboxes one for the qty,product,unit price,total. but i don't want just one set of these is there a way to make it a continuious. for instants let say that the customer has several things he is buying how can i do this with just one set of txtboxes or do i add more txtboxes to do this
Jul 23 '07 #4
lee123
556 512MB
by the way im using vb 6 thanks
lee123
Jul 23 '07 #5
Killer42
8,435 Expert 8TB
by the way im using vb 6 thanks
Excellent! In that case, you can use a control array. And that means you can easily add new occurrences to the array(s) at runtime.

However, you need to consider what is appropriate. If you keep adding textboxes, then you're going to run off the end of the form, then you have to start looking into how you can scroll things around, and it just keeps getting more complicated.

It'd probably be smarter to look into the various grid controls available in VB.
Jul 23 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Joey | last post by:
Say a customer inserts into a sql database field (NUMINSERTS) the number 6. On the following page, I want to build a table that displays 6 input boxes, since the customer said they wanted 6 text...
2
by: reneeccwest | last post by:
Different user input boxes are automatically populated based on a value of the dropdown box. Can anyone help me on that?
3
by: KathyB | last post by:
Hi, I'm trying to find a way to validate input text boxes where I don't know the names until the page is rendered. I've got 2 validate functions that fire with the onsubmit button of a "mini" form...
4
by: KathyB | last post by:
Sorry this is a bit of a repost because I wasn't quite accurate in my original. I have an hmtl page with a function to see if there are any input type=text boxes. If so, that means a user did...
3
by: Lozette | last post by:
Hi all, I'm wondering if anyone else has noticed some odd behavious with IE6.0 colouring input boxes yellow (or any other colour!) unexpectedly? I am using IE6.0.2 on WinXP Pro. I had a bug...
3
by: Frostillicus | last post by:
I work with Interwoven TeamSite in an environment where I do not have access to customise the default stylesheet, so the only option available to me is to specify an additional stylesheet wherein I...
2
by: Shabam | last post by:
I was told that dotnet generates classes for input tags like this: <span class="hello"><input type= "checkbox"></span> The problem here is, the "input" class is overriding the "hello" class....
2
by: jackson2005 | last post by:
OK, I need to do three different things. On the ONLOAD event I would like a popup box to open. In this popup box I need two text boxes. One for the UserName and one for the BillingTo name. ...
13
by: amykimber | last post by:
Hi all, I know I'm doign something really daft, but I can't get this to work... I have a form with a bunch of inputs called ship_owner - why the ? Because I'm submitting this page though php...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.