Results 1 to 9 of 9
  1. #1
    Join Date
    May 2004
    Posts
    56

    Exclamation Unanswered: Combo Box: Refresh/Update

    (NOTE: Unfortunately, the replies below so far haven't helped. Anyone else?)

    I have a combo box (drop down) on form meant to help users jump between all records in the related table. Problems are:

    1) what whenever the record viewed is deleted or a new record is added, the combo box isn't updated (shows #DELETED# or not the new record). I've tried saving new record, still doesn 't appear. The only way the list is updated is when I leave the form then return to it.

    2) How can I get the item shown on the combo box to sync with the record when I manually navigate forward or back to another record?

    Long ago I knew how to correct this but can't recall now. Ugh! Can anyone help with these hopefully simple questions. (I'm not an advanced user.)

    ****NOTE: I've already tried using me!formname.requery and it made no difference.

    Thanks.
    Last edited by paulzak; 08-27-04 at 10:58.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    whateverTheComboIsCalled.requery

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Jul 2004
    Location
    South Dakota
    Posts
    267
    After you make your changes to the records you should requery the combo box.

    cboBox.Requery

    Canupus



    Quote Originally Posted by paulzak
    I have a combo box (drop down) on form meant to help users jump betwween all records in the related table. Problems are:

    1) what whenever the record viewed is deleted or a new record is added, the combo box isn't updated (shows #DELETED# or not the new record). I've tried saving new record, still doesn 't appear. The only way the list is updated is when I leave the form then return to it.

    2) How can I get the item shown on the combo box to sync with the record when I manually navigate forward or back to another record?

    Long ago I knew how to correct this but can't recall now. Ugh! Can anyone help with these hopefully simple questions. (I'm not an advanced user.)

    Thanks.

  4. #4
    Join Date
    May 2004
    Posts
    56
    Quote Originally Posted by izyrider
    whateverTheComboIsCalled.requery

    izy
    Thanks, but already tried that and it didn't work. Is there some other detail that I'm missing or another solution you have?

  5. #5
    Join Date
    May 2004
    Posts
    56
    Thank you both, but I already tried that and it didn't work. Is there some other detail that I'm missing or another solution you have?

  6. #6
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Can you post the code you have in your form. That may help us to analize what it needs and why the .requery isnt working because that is really the right way to do it.

    Thanks,
    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  7. #7
    Join Date
    May 2004
    Posts
    56
    Folks, I appreciate the interest and hope someone can help. As requested, here's the code and more details. At another site, a fellow user gave me the following input that is closer to the mark but still not working completely.

    1) Updating list: I was told to try putting refresh code in the form's events: * AfterUpdate
    * On delete.
    I couldn't get "refresh" to work so I went with Requery, mentioned in this form: Me.Combo108.Requery. I now see newly added records in the list just fine but still seeing #Delete# when I delete one and that gives user error should they click on that from list. Only clears from list if I leave form and return. This box is NOT bound to any field.

    2) Syncing: I was advised to related box's value to table field in the On Current event. I added code: ' Me!Combo108.Value = Me!FILE _Nbr, which did show it syncing but would give me an error (invalid entry) after I deleted a record so I've turn code off for now. Any details I'm missing here?

    Again, I appreciate the help!

  8. #8
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    "...when I delete one..." means an event took place somewhere.

    if you stick
    Me.Combo108.Requery
    (or the appropriate equivalent if Me and the "when I delete" event are on different forms)
    in the event concerned ...it simply works!

    so... to resolve this mystery:
    what event in which form* "causes" the delete ?
    which form* holds Combo108

    Note*: and if subform, which parent form* ? '...recursive!

    izy
    currently using SS 2008R2

  9. #9
    Join Date
    Nov 2003
    Posts
    11
    I had the same problem. I put a refresh line in on my Got Focus event. It seems to work fine now.

Posting Permissions

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