Results 1 to 12 of 12
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box on Form

    Here's a simple refresher for you professionals out there...

    I used the combo box wizard to put a combo box on my form. I selected the option, 'Find a record on my form based on the value I selected in my combo box.'

    This is working like a charm, however when I navigate my records, the field in question is not updating.

    The combobox's control source is the table the data is being 'saved' to, while the row source is a query pulling data in a list from the same control source. How can I make this combo box update itself when I navigate through records on my form?

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    Hi Drk,
    You could try requerying the combo box each time you navigate to a different record. Something like the following should work:<pre>Private Sub Form_Current()
    cboComboBox.Requery
    End Sub</pre>


    Hope this helps <img src=/S/2cents.gif border=0 alt=2cents width=15 height=15>

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    I put that code in, but it's still not updating when I navigate, any ideas?

    Thanks again!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    Double check to be sure that the code is using the correct name of your combo box object in the line:<pre><Your_Combo_Box's_Name_Here>.Requery</pre>


  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    Yeah, it was, still didn't work.

    I finally did it by viewing my field list, dragging the field onto the form, and changing the box to a combo-box. Then I added my query for the source data, and it worked like a charm! [img]/forums/images/smilies/smile.gif[/img]

    Thanks for all your help!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    Sorry I wasn't much help. I'm glad you got it working.

    It sounds like the Control Source of the Combo Box wasn't bound to the field. When you re-added the field to the form, the Control Source was automatically bound.
    Hindsight is always 20/20... <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22>

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    Hey.. nice incorporation of the flags! <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15> <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  8. #8
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    Thanks Drk... <img src=/S/smile.gif border=0 alt=smile width=15 height=15> Good ol' Paint Shop Pro 7 <img src=/S/trophy.gif border=0 alt=trophy width=15 height=15>

    But you're the undisputed GIF King! <img src=/S/bow.gif border=0 alt=bow width=15 height=15> <img src=/S/salute.gif border=0 alt=salute width=15 height=20> <img src=/S/king.gif border=0 alt=king width=21 height=22>

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Box on Form

    The reason for the unbound state is that when you select the option to 'Find a record on my form based on the value I selected in my combo box', you're creating a navigation tools not a control for entering data. The wizard created exactly what you asked for, which is a standard method of navigating through the records in a form.

    I don't understand what you're saving when you use the combobox to navigate through the records. What you'll get is the value of the combobox selection, but I don't see how that could be valid data, since it's only going to be a pointer to another record.
    Charlotte

  10. #10
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    What I have is a box which contains social security numbers. The idea was that if the member had already been added, his/her social would appear if the box was a combo box. By using the combo box as a navigation AND data entry tool, we can tell at a glance if the individual is in our system, and if so, hit <enter> to 'navigate' to the proper entry.

    It's apparent now that this isn't working as it should.. so once again, i'm open to suggestions... [img]/forums/images/smilies/wink.gif[/img]

    thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  11. #11
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    Hi Drk,

    After reading your last post I had an idea <img src=/S/lightbulb.gif border=0 alt=lightbulb width=15 height=15> <img src=/S/exclamation.gif border=0 alt=exclamation width=15 height=15>

    You could use the Combo box for navigation, but you could add a toggle button for editing. If the button is pressed (True, I think), write some code to hide the Combo Box and make a Text Box visible in its place - for data entry. You would probably want to advance to a new record or switch the form momentarily to Data Entry mode or something.

    When the toggle button is not pressed (False, I think), have the Combo Box visible for navigation as usual.

    Post back if you need any help putting the code together for that. <img src=/S/eyeout.gif border=0 alt=eyeout width=15 height=15>

    Good luck!! <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

  12. #12
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box on Form

    3 minutes after the previous post.... <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22>
    Oh boy, the brainwaves are flowing now!! <img src=/S/electric.gif border=0 alt=electric width=15 height=15>

    You could use the combo box for navigation but write the code to intercept an entry if it's not in the list. There is a decent code example of this included with the Solutions.MDB sample database that comes with Office 97 (and presumably 2000 also - but I can't locate it).

    I hope either of these ideas (this post or the previous) point you in the right direction. Good luck! <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

    By the way....is your Usename short for Dark Realm, or Dr. K.....?? <img src=/S/question.gif border=0 alt=question width=15 height=15> <img src=/S/question.gif border=0 alt=question width=15 height=15> That's always baffled me <img src=/S/headthrob.gif border=0 alt=headthrob width=15 height=15>

Posting Permissions

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