Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2004
    Posts
    16

    Unanswered: How to set text box values with combo boxes

    Subject: How to set text box values with combo boxes

    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. The attached is a 98 KB zipped file, which includes the database and a specific example. 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 box labeled "Kreyol."
    (3) On the page labeled "Espanol," click the combo box labeled "Conjugacion." Only three possible choices should be available (hablar, comer, mentir). 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)".

    Thanks,
    -Dave
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2004
    Location
    Pune, India
    Posts
    14

    Re: How to set text box values with combo boxes

    Hi Friend,

    I have seen you database, but could not figure out what's thew problem. The example you have given seems working fine. Am I missing anything ?

    Regds

  3. #3
    Join Date
    Mar 2004
    Posts
    16
    Thanks for the reply. The db may seem to be working fine, but it's not. That's what I meant when I said that I was so close to getting it figured out.

    There should not be more than 3 choices ("hablar," "comer," "mentir") in combo box "cboConEsp" and no more than 3 choices ("falar," "comer," "mentir") in combo box "cboConPor."

    What happens with the form as it is now, is a new record gets created for both combo boxes. The values of the combo boxes should come from fixed table "tblConjugations," not table "tblInfinitives," which is editable.

    In step #3 when you click 1 of the combo boxes to set the value of the other combo box and the values of 6 of the 8 remaining text boxes, a value gets filled in to field "fldConId" of table "tblInfinitives," which should be the same as that of field "fldConId" of table "tblConjugations." Also a numeric value gets created in field "fldInfKreId" in table "tblInfinitives."

    Please don't leave me high and dry!

  4. #4
    Join Date
    Apr 2004
    Location
    Pune, India
    Posts
    14
    Hi Friend,

    I saw the the query "SELECT tblConjugations.fldConId, tblConjugations.fldEspCon FROM tblConjugations; that you have used for cboConEsp. but "SELECT qryVerbs.fldInfPor FROM qryVerbs" has been used for cboConPor. If you require both the combo to populate from tblConjugations, then write similar query for cboConPor also, with relevent change in the name of the field to be chosen. I hope the change in query should affect the output you r desiring

  5. #5
    Join Date
    Mar 2004
    Posts
    16

    Good suggestion, but no fix

    Originally posted by aqua_zinc
    Hi Friend,

    I saw the the query "SELECT tblConjugations.fldConId, tblConjugations.fldEspCon FROM tblConjugations; that you have used for cboConEsp. but "SELECT qryVerbs.fldInfPor FROM qryVerbs" has been used for cboConPor. If you require both the combo to populate from tblConjugations, then write similar query for cboConPor also, with relevent change in the name of the field to be chosen. I hope the change in query should affect the output you r desiring
    I implemented your suggestion. Please see attached. Thanks! Please don't give up on this!
    Attached Files Attached Files

  6. #6
    Join Date
    Apr 2004
    Location
    Pune, India
    Posts
    14
    Hi friend,

    I tried to replicate the output that you are trying and I have some suggetions to make.

    If I understand your requirement correctly then
    a) For a new record, you will fill in the first four text boxes.
    b) The first combo should now get populated with already added values and the newly added one of the second text box.
    c) Now you need to fill in rest of the three text boxes on the same page and do the same for the remaining pages.

    When you navigate through already added records, the combo should show the relevent text and also allow flexibility to change and see other records.

    ------------------------------
    Now if the above stated requirement is correct then it is not so straight forward as it seems. Try this approach.

    1) Don't control the navigation of records using the navigation button of the form. Instead disable them, instead add buttons on the form and write the navigation code in the VB editor. This way you will be having more control.
    2) Make all the controls Unbound and as I said, populate the values from the code.
    3)Populate the combo from code and on its click event, change the values of the next three text boxes.

    IF you r not able to accomplish this, let me know, I will be more than happy to send you the sample code for just 1 page (out of the three). Also, correct me if my understanding of the requirement is totally on different frequency.

    Regds.

  7. #7
    Join Date
    Mar 2004
    Posts
    16

    Not exactly...

    a) For a new record, you will fill in the first four text boxes.

    So far so good


    b) The first combo should now get populated with already added values...

    Right again

    ...and the newly added one of the second text box.

    Not so.

    c) Now you need to fill in rest of the three text boxes on the same page and do the same for the remaining pages.

    No.

    When you navigate through already added records, the combo should show the relevent text...

    Yes.

    and also allow flexibility to change and see other records.

    I just want to be able to scroll through existing records.


    Please allow me to attempt to clarify and to beg your patience. I'll start from the beginning of creating a new in the interest of clarity.

    (1) Enter "to walk" in the text box labeled "English." Enter "andar" in the text box labeled "Espanol." Enter "andar" in the text box labeled "Portugues." Enter "manje" in the text box labeled "Kreyol."

    (2) Click either the combo box labeled "Conjugacion" on page "Espanol" or click the combo box labeled "Conjugasao" on page "Portugues." Select "hablar" from the 3 and only 3 possible choices of "hablar," "comer," or "mentir" of the combo box labeled "Conjugacion" or select "falar" fro the 3 and nly 3 possible choices of "falar," "comer," or "mentir" of the combo box labeled "Conjugasao" on page "Portugues."

    As soon as you select either "hablar" from the combo box on page "Espanol" or "falar" from the combo box on page "Portugues," the collectively 6 text boxes on those 2 pages get populated, based on what you've selected in whichever combo box.

    The values of the combo boxes and the values of the 3 text boxes on page "Espanol" and 3 text boxes on page "Portugues" are all fields of the same record in table "tblConjugations." You'll never type anything into these 6 text boxes. Their values get set depending on what the combo boxes' values are.

    (3) Click page "Kreyol." Enter text into the 2 text boxes there.

    END

    The only text boxes you ever enter anything into are the four at the top of the form and the 2 on page "Kreyol."

    Thanks,
    -Dave

  8. #8
    Join Date
    Apr 2004
    Location
    Pune, India
    Posts
    14
    its getting interesting time and again! So how is the tblConjugations getting populated!

  9. #9
    Join Date
    Mar 2004
    Posts
    16
    Originally posted by aqua_zinc
    its getting interesting time and again! So how is the tblConjugations getting populated!
    I'm apologize for the tediousness!

    Table "tblConjugations" is fixed. No additional records will ever get added to "tblConjugations." It has only three records (as a prototype).

    All 3 of the other tables, however, may have infinite records.

    Thanks,
    -Dave

  10. #10
    Join Date
    Apr 2004
    Location
    Pune, India
    Posts
    14
    Hi friend,

    Since you have waited so long, I would request u to wait for some more time. I am trying to replicate the application. I will send you the code and see if it is what u require.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •