Listbox selected double click update value

Akai90

Member
Local time
Today, 21:42
Joined
Feb 8, 2022
Messages
67
hai,

i got some issue with listbox double click

my code here

Code:
Private Sub listgurufilterips_DblClick(Cancel As Integer)
Dim MyDB As Database, MyTable As Recordset
Dim JWBCONFIRM As String
    Set MyDB = DBEngine.Workspaces(0).Databases(0)
    Set MyTable = MyDB.OpenRecordset("TGuruIPS", DB_OPEN_TABLE)
   MyTable.Index = "noid"
   MyTable.Seek "=", Forms![FkemaskiniPG]![listgurufilterips]
    JWBCONFIRM = MsgBox("Pasti mahu tukar?", vbYesNo, "SAHKAN TUKAR")
    If JWBCONFIRM = vbNo Then
           Forms![FkemaskiniPG]![listgurufilterips].SetFocus
           SendKeys "{DOWN}"
           Exit Sub
    Else
          With MyTable
          .Edit
          !KodInstitusi = " "
          !JenisInstitusi = " "
          !Alamat = " "
          !Institusi = " "
          !status = "BERHENTI"
          .Update
          End With
          DoCmd.OpenQuery "QListFilterGuru"
          Me![listgurufilterips].Requery
          Forms![FkemaskiniPG]![listgurufilterips].SetFocus
          SendKeys "{DOWN}"
          DoCmd.Close
    End If
End Sub

when i double click the list box seleted item value with update with data i want.
 
when i double click the listbox nothing happen...

i want.. when i double click selected data in list box.. some value will change to this..

Code:
.Edit
!KodInstitusi = " "
!JenisInstitusi = " "
!Alamat = " "
!Institusi = " "
!status = "BERHENTI"
.Update
 
So walk your code with F8 and breakpoints. :(

Debugging 101.

Why are you clearing the first record in the recordset, regardless of what entry in the listbox is selected?
 

Users who are viewing this thread

Back
Top Bottom