HELP Forms, combo boxes, text boxes 
Author Message
 HELP Forms, combo boxes, text boxes

Greetings Everyone, I have a slight problem. I'm New to VB and I have
started a project for my company that I work for.

I have built two forms with various combo boxes, list boxes, check boxes,
lines, borders and text boxes. There are two forms, one that the user needs
to input info and the other were they check certain items.

Problem one: I have built a sample program from the Microsoft book were you
can add name into a text box, push a add button and then the names into a
list box...I would like to be able to have those name added into combo boxes
on my form and be able to remove them with that same program.

Problem two: I would like to be able to save the info the user inputs into
the different text boxes...once you tab through the page and input the info
and go to the next page and come back to form1 the info is gone!!!! How do I
keep it there and then save it?

Problem Three: Once  I have saved all this info from both from can I print
it, and can I save it then reload it and print it? Basically the forms stay
the same...user loads the program inputs the information; name address etc
and on the other form check item used and then prints it all out the form
with the information.

I Thank any help given and will give credit in my program.

Thanks
Stewart , NEW to VB



Sun, 17 Nov 2002 03:00:00 GMT  
 HELP Forms, combo boxes, text boxes
Problem1:  You can add items to a combo box using the AddItem method and
remove them using the RemoveItem method.  The parameter for each of these is
the index of the item to be removed.  I suspect from your description that
you don't know this - rather you only have the text.  The index can be
retrieved from the text value by using the following:
    1.    In a basic module add:
            Public Declare Function SendMessage Lib "user32" Alias
"SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As
Integer, ByVal lParam As Any) As Long
            Public Const CB_FINDSTRING = &H14C

    2.    lngIndex = SendMessage(cmbCombo.hWnd, CB_FINDSTRING, -1&,
strValue)
            Where cmbCombo is your combo box and strValue is a string
variable with the value you want to look up.


Quote:
> Greetings Everyone, I have a slight problem. I'm New to VB and I have
> started a project for my company that I work for.

> I have built two forms with various combo boxes, list boxes, check boxes,
> lines, borders and text boxes. There are two forms, one that the user
needs
> to input info and the other were they check certain items.

> Problem one: I have built a sample program from the Microsoft book were
you
> can add name into a text box, push a add button and then the names into a
> list box...I would like to be able to have those name added into combo
boxes
> on my form and be able to remove them with that same program.

> Problem two: I would like to be able to save the info the user inputs into
> the different text boxes...once you tab through the page and input the
info
> and go to the next page and come back to form1 the info is gone!!!! How do
I
> keep it there and then save it?

> Problem Three: Once  I have saved all this info from both from can I print
> it, and can I save it then reload it and print it? Basically the forms
stay
> the same...user loads the program inputs the information; name address etc
> and on the other form check item used and then prints it all out the form
> with the information.

> I Thank any help given and will give credit in my program.

> Thanks
> Stewart , NEW to VB




Sun, 17 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Putting a value from a combo box into a text box on a form

2. Created Form in Word - Irregular movement of combo boxes, text boxes on scrolling

3. populate text box from combo box (same form)

4. Limiting Access to Text Boxes, List Boxes and Combo Boxes

5. Combo Box and Text Box - Plz Help

6. **Help Keep focus of a text box while chosing font from combo box

7. Help filling second combo box from fist combo box

8. Help filling second combo box from first combo box

9. Unable to populate text box from combo box

10. Filling combo box text box area from data

11. Adding to a combo box or text box through the keyboard

12. Combo Boxes and Text Boxes

 

 
Powered by phpBB® Forum Software