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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set text box values with combo boxes

Status
Not open for further replies.

etalent

Programmer
Jun 9, 2003
23
0
0
US
I've got a simple database that has 4 tables and a form with 14 controls on it. The controls are all text boxes except for 2 combo boxes. I'm very close to getting the functionality right, but I just can't quite get it. I have found that my first attempts at getting help don't get too far maybe because this simple database quickly seems not so simple once I try to explain it.

I want to be able to (1) scroll through existing records or (2) add new records. Generically speaking, to add new records, all I want the form to do is the following:

(1) Click the add new record button.
(2) Type in something in the first 4 text boxes.
(3) Click 1 of the combo boxes to set the value of the other combo box and to set the values of 6 of the remaining text boxes.
(4) Type something into the remaining 2 text boxes.

Things get more confusing with specific examples. Ideally, you should be looking at the database itself, so you can see the table, fields, relationships, and controls. I've got a 95 KB zipped file ready to go, which includes the database and a specific example. Please let me send it to you. Until then, here is the same example as that I provide in the zip file:

(1) Click the add new record button.
(2) Type in "to walk" in the text box labeled "English." Type in "andar" in the text boxes labeled "Espanol" and "Portugues." Type in "manje" in the text boxe labeled "Kreyol."
(3) On the page labeled "Espanol," click the combo box labeled "Conjugacion." Select "hablar." The value of the text box labeled "Present Participle" is set to "hablando." The value of the text box labeled "Past Participle" is set to "hablado." The value of the text box labeled "Imperative" is set to "hable." On the page labeled "Portugues" the value of the combo box labeled "Conjugasao" is set to "falar." The value of the text box labeled "Present Participle" is set to "falando." The value of the text box labeled "Past Participle" is set to "falado." The value of the text box labeled "Imperative" is set to "fale." On the page labeled "Kreyol" the 2 text boxes are blank.
(4) On the page labeled "Kreyol" in the text box labeled "Expression" type "(manje placeholder)". In the text box labeled "English Interpretation" type "(to walk placeholder)".

Please let me know how to send you the little database at your soonest convenience!

Thanks,
-Dave
 
How are ya etalent . . . . .

Send it as an attachment to acemanforums@nyc.rr.com

cal.gif
See Ya! . . . . . .
 
Hi

There is a FAQ on this forum which explains how to make one combo box dependant on another combo box.

To set values into text boxes depending on the value chosen from a combo box, it is prbably simplest to make the combo box a multi column combobox, set the width of the columns you do not wish the user to see to zero. Then once you have done that you can set the values of the text boxes in the after update event of the combo box so:

txtBoxControl = cboComboBoxControl.Column(1)

note the column numbers begin from zero, so .column(1) is the second column etc etc

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks Ken. More happens than just setting values, however. Fields in tables get filled in too. I'm really close. This is so frustrating.

 
Hi

I assumed that, which is why I suggested teh code I did, if you just wanted to disply the values no code as such would be necessary, you would simply use =Combo.Column(1) in the text box source, anyway no problem, looks like aceman1 has picked it up

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
How are ya etalent . . . .

I spent about an hour going over the DB and another half hour trying to figure a way to tell you I can't help ya . . .

The fact that the DB main function apparently has to do with [blue]cross referencing languages[/blue], its hard to tell what you are doing or even if the table relationships are correct. Even harder to tell if your code functionality is alright. Although I could makes sense of some things, they are not worthy of mention and wouldn't help you anyway.

No . . . . the DB is not complicated, it just requires someone like yourself who knows the languages and is perferably a DB Hot-Shot. It will be extremely hard for anyone to help you unless they know, or can at least, relate to the language barriers.

Good Hunting in finding that someone!



cal.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top