dblclick event in listbox not firing

funk44

New member
Local time
Today, 09:34
Joined
Nov 1, 2013
Messages
9
Hi guys

Hopefully this is the right place to put this

I have an issue with the dblclick event not firing immediately from my listbox. It does eventually fire if i mash the mouse button for long enough but obviously that is not an acceptable solution.The listbox also has an afterupdate event which is what fires when i double click

I have also tried calling the code from an onclick command button which works fine but if i try and call that from the dblclick event it does not

I have used the dblclick event in other projects with afterupdate and it has worked without problem so im a bit stumped on this one

Hoping someone can help. Thanks in advance

Code:
  Private Sub lstFileList_AfterUpdate()
   
  strPDF = Me.lstFileList.Column(0)
   
  Me.PDFViewer.LoadFile (strPDF)
   
  Dim fso As New FileSystemObject
   
  strFileName = fso.GetFileName(strPDF)
   
  Me.txtDate = Now
  Me.txtUser = glblUser
  Me.txtFile = strFileName
   
  Me.txtAB = ""
   
  End Sub
Code:
  Private Sub lstFileList_dblClick(Cancel As Integer)
   
      On Error GoTo Err_cmdDblClick
      
      If checkNull(Me.lstFileList) = False Then
      
          Dim stDocName As String
          Dim stLinkCriteria As String
      
          stDocName = "frmRej"
          DoCmd.OpenForm stDocName, , , stLinkCriteria
         
          If Me.Dirty Then Me.Dirty = False
          DoCmd.Close acForm, Me.Name
      
      End If
   
  Exit_Err_cmdDblClick:
      Exit Sub
   
  Err_cmdDblClick:
      MsgBox Err.Description
      Resume Exit_Err_cmdDblClick
   
  End Sub
 
Does it work any better if you try this...

Code:
      On Error GoTo Err_cmdDblClick
 
          DoCmd.OpenForm "frmRej"
 
          If Me.Dirty Then Me.Dirty = False
          DoCmd.Close acForm, Me.Name
 
  Exit_Err_cmdDblClick:
      Exit Sub
 
  Err_cmdDblClick:
      MsgBox Err.Description
      Resume Exit_Err_cmdDblClick
 
Thanks for the quick response

It doesn't change anything unfortantly, it just refreshes the Acrobat ActiveX object as it was before, again, if i mash the mouse button for long enough the event eventually fires
 
Comment out this line and it will work as expected.
Thanks for that it does work, the issue is that i need to call that to load the pdf in the activex object

Are you aware of any work around for this or am i stuck with calling the form through a command button?

Cheers
 
The problem is the After Update event will fire every time you click on the listbox and because you have a pdf viewer control, Access hands over to the control to do its thing (so to speak), so there isn't enough time for a second click to be counted.

So you need to think of a way of not re-loading the pdf file if it's a double click or handle the loading of the pdf file in a button click. You can call the button "Load PDF". Or move the code to the double click event. It makes more sense that way.
 
The problem is the After Update event will fire every time you click on the listbox and because you have a pdf viewer control, Access hands over to the control to do its thing (so to speak), so there isn't enough time for a second click to be counted.

So you need to think of a way of not re-loading the pdf file if it's a double click or handle the loading of the pdf file in a button click. You can call the button "Load PDF". Or move the code to the double click event. It makes more sense that way.
Yep, that makes sense. I think i'll go with a button to load the form rather than the PDF for the purposes of this program

Thank you very much for your assistance, much appreciated
 

Users who are viewing this thread

Back
Top Bottom