Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Aug 2002
    Location
    Michigan, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Combo Box updates other control (2000)

    Newbie needs your expertise. How do I get the results of a combo box to update another control on the form. Can someone please be kind enough to check out the sample database I sent. I don't understand this at all...
    Thank you...
    Steve (swambast@hotmail.com)
    Attached Files Attached Files

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Combo Box updates other control (2000)

    I change the rowsource of the combobox to include the phone number.
    The controlsource of text4 is removed.
    In the afterupdate event of the combo I enter (columns in a combo start counting with 0, so column(1) is the second):
    <pre>Private Sub AdminFullName_AfterUpdate()
    Me.Text4 = Me.AdminFullName.Column(1)
    End Sub</pre>

    In the on current event of the form I call the afterupdate Sub from the combo
    <pre>Private Sub Form_Current()
    AdminFullName_AfterUpdate
    End Sub</pre>

    Hope this help
    Attached Files Attached Files
    Francois

  3. #3
    Star Lounger
    Join Date
    Aug 2002
    Location
    Michigan, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Combo Box updates other control (2000)

    Francois,

    Thank you very much for your quick response and for your time, I really appreciate it. I see you are using code to do this. Do you know if it can be done without the code by setting up some type of relationship?

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Combo Box updates other control (2000)

    I think yes, but code is so powerful that you should start to learn it.
    If you have problems with it, just ask here in the lounge and somebody will help you.
    Francois

  5. #5
    Star Lounger
    Join Date
    Aug 2002
    Location
    Michigan, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Combo Box updates other control (2000)

    Yes, you solved this in 5 minutes - I already see the VBA benefits!!!

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Form Combo Box updates other control (2000)

    You can do this without code, although I agree the code solution is more elegant.

    Put the control you want to update automatically in a small subform bound to a query. Also include a hidden copy of the field that the combo box is bound to, and use this field as the linking field.
    Regards
    John



Posting Permissions

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