Share via

Refresh a combo box after adding a record

Anonymous
2022-02-07T21:03:02+00:00

Community,

I know these are easy for experienced Access developers, but I am not one. I have a combo box (Part Number) on a form and I have a form to add a new part number.

The Add Part Form is:

I am just trying to update the Combo Box with the added record. I image it is a Requery or Refresh of that combo box in the Save and Close macro, but can't get the syntax correct. The form is frmPartTracker and the Control Name is ComboPartNum.

Microsoft 365 and Office | Access | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2022-02-08T14:41:48+00:00

    Thanks Tom, I'll look into that.

    John

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-02-08T14:41:18+00:00

    Thanks, I'll look into that.

    Was this answer helpful?

    0 comments No comments
  3. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2022-02-08T05:25:03+00:00

    Actually, better than that is the use of List Items Edit Form in combination with Allow Value List Edits. This is an almost zero code replacement of the NotInList event.

    Was this answer helpful?

    0 comments No comments
  4. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2022-02-08T05:13:41+00:00

    Interesting, I just worked on this myself last Friday.

    My first instinct was: Forms!frmPartTracker!ComboPartNum.Requery

    But what that does is get a fresh value of PartNum, and thus possibly selecting a different item in the dropdown list.

    To requery the list itself, I used:

    Forms!frmPartTracker!ComboPartNum.RowSource = Forms!frmPartTracker!ComboPartNum.RowSource

    The new item then showed up.

    Was this answer helpful?

    0 comments No comments
  5. ScottGem 68,830 Reputation points Volunteer Moderator
    2022-02-08T05:12:19+00:00

    I suggest you do some research on the NotInList event of comboboxes. This is the better way to enter new data.

    Was this answer helpful?

    0 comments No comments