Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add a new record from combo box (2000)

    Hi,
    I like to be able to double click on a Vendor combo box and have it take me to the Vendor form so I can add a new Vendor to the list.
    Thanks,
    Deb

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

    Re: Add a new record from combo box (2000)

    Unless you have been discussing this in another thread that I've missed, your question is a little vague. Where is the Vendor combobox, on what form? Is the vendor form open, closed, visible, hidden, or a subform? What do you mean by "take me to the vendor form"? Do you want the vendor form to pop up or is it already there and you just want to navigate to the selected record?
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add a new record from combo box (2000)

    Sorry Charlotte, I didn't realize my question was vague. The vendor combo box is on form A. The vendor form is just another form that exists in the database (so we have 2 separate forms). What I mean by "take me to the vendor form" is when I double click on the combo box, the vendor form will then open and appear on the screen, hence; "taking me to the vendor form" so I can add a new vendor. I have seen this done on other databases but cannot locate them to view the code to figure out how to do it.
    Thanks,
    Deb

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Add a new record from combo box (2000)

    Here is the answer to your question, but you'll probably want more than that:

    Private Sub cboVendor_DblClick(Cancel As Integer)
    DoCmd.OpenForm "frmVendor", , , , acFormAdd, acDialog
    Me.cboVendor.Requery
    End Sub

    where cboVendor is the name of the combo box and frmVendor is the name of the form you want to open. The code opens the form in add mode, i.e. for entering a new record, and requeries the combo box when the user has closed the form, to display the updated vendor list.

  5. #5
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add a new record from combo box (2000)

    Thanks Hans, that did the trick.

    Deb
    <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

Posting Permissions

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