Results 1 to 3 of 3
  1. #1
    AmanKaur123 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    47

    On the close event of a form , update listbox in the other form.

    Hi Guys



    I have a list box on form "frmMain" , when the user double click on any item in the list box then a form "frmCall" opens up with all its details. Now what I want is when they update the details on the form "frmCall" and come out of it (close frmCall) then command15_click event should be called. But at the moment when the 'frmcall' opens up then the event Command15_click event is called.

    ANy help will be much appreciated.
    Code:
    Private Sub lstSupActivities_DblClick(Cancel As Integer)
    Dim i As Integer
    Dim sSQL As String
    Dim sForm As String
    For i = 0 To lstSupActivities.ListCount - 1
        If lstSupActivities.Selected(i) Then
           sForm = "frmCall"
           sSQL = "[AuditID]=" & Me.lstSupActivities.Column(1)
           DoCmd.OpenForm sForm
           DoCmd.OpenForm sForm, , , sSQL, , WindowMode:=acDialog
           Command15_Click
           ' DoCmd.OpenForm "frmCallAudit_New", , , sSQL
           Exit For
         End If
     Next i
    End Sub

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure where Command_15 comes into it, all you need is in the OnClose event to requery the listbox on the main form.

  3. #3
    AmanKaur123 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    47
    yES . GOT IT. THANKS

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 07-19-2016, 05:28 PM
  2. Replies: 13
    Last Post: 09-10-2015, 03:37 PM
  3. Replies: 2
    Last Post: 07-05-2015, 09:10 AM
  4. close Form from within a Form.current event
    By alextijuca in forum Access
    Replies: 7
    Last Post: 03-19-2015, 11:31 AM
  5. Replies: 1
    Last Post: 03-06-2012, 10:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums