Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    19

    Unanswered: combo field listing...

    I have a form which I am deleting records ...

    The form has a combo box with a query as the row source.

    The user selects a name from the combo box.. hits the delete button and that name gets removed from the query.

    My question is.. once the user hits delete is there a way to refresh the list in the combo field..

    Right now I have the form to close then open up again.. but i thought I clean up the code a bit..

    any suggestions ?

    thanks

  2. #2
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by azndre
    I have a form which I am deleting records ...

    The form has a combo box with a query as the row source.

    The user selects a name from the combo box.. hits the delete button and that name gets removed from the query.

    My question is.. once the user hits delete is there a way to refresh the list in the combo field..

    Right now I have the form to close then open up again.. but i thought I clean up the code a bit..

    any suggestions ?

    thanks

    Hi,
    Plucked right out of my database to remove the record and requeries the form and control.
    Code:
    Private Sub cmbDeleteRecord_Click()
    On Error GoTo Err_cmbDeleteRecord_Click
    
    
        DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
        DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
        DoCmd.Requery "sfrmJobChargesViewAll"
        DoCmd.Requery "JobID"
        
    Exit_cmbDeleteRecord_Click:
        Exit Sub
    
    Err_cmbDeleteRecord_Click:
        MsgBox Err.Description
        Resume Exit_cmbDeleteRecord_Click
        
    End Sub
    Bud

Posting Permissions

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