Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2002
    Posts
    21

    Unanswered: Combo box to fill text box

    I have multiple bound combo boxes but I need one in particular to fill in address information. Basically I have cmbcontact which allows the user selects a billing location. Once they have selected from the combo list I want the billing address displayed in a textbox (txtbadd1). Text boxes do not contain row source so how do I do this? Thanks.

  2. #2
    Join Date
    Jun 2004
    Posts
    16
    You would use a DLookup

  3. #3
    Join Date
    Apr 2002
    Posts
    21
    Can you explain a bit further? txtbadd1 is a bound text box (need to capture this in a SQL table). Where do I place this code? Thanks.

  4. #4
    Join Date
    Jun 2004
    Posts
    16
    In the control source of your text box
    (Assuming your billing address location is stored in tblLocation and your PK field is named LocationID. I am also assuming that your combo box is bound to location ID.)


    =DLookup("BillingAddress", "tblLocation", "LocationD = 16")


    Your text box should be unbound. You should not be storing the same value in different places within your db.

  5. #5
    Join Date
    Apr 2002
    Posts
    21

    I'll try to clear this up.

    I have a form which users will enter information. This information will be stored in an SQL table called Sales. I created the form with drop down menus such as client (cmbclient) and client contact (cmbcontact1). Each client contact has a different billing location. When a user selects from cmbcontact1, I want the first line of the billing address to appear in the text box (txtbadd1). I will need to store the address from txtbadd1 as an individual record since we are tracking each sale separately. I can't make the textbox unbound because I have to store it in the table under the field "billing address". It worked when I had the txtbadd1 as a combo box because I had the rowsource property but the combo box did not display the address rather the user had to "Select" the address from the drop down. Since there is only one address I changed it to a text to display. That is my problem currently. Hope that clears it up. Thanks.

Posting Permissions

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