Hi All,
I have a form that maintains data in a Parent Header Table while displaying data via a ListView from a Child Detail Table. The listview has various features such as Hover and a double-click event that opens a popup dialog form to edit its data.
While editing the parent, I would like to 1) Gray out or give a clear appearance that the listview is disabled when the user clicks the cmdEdit button. 2) Disable the click event. <Edit: I still want to display the rows.>
Pretty sure that it can not be done using built-in features of the listview, but what if I could put a transparent control over the listview so that it is still visible but in the back so it can not be clicked?
When finished editing the parent and the user clicks the cmdSave button, then the listview is restored of its functions.
My project is ADP, my form is UnBound using ADO connection to a SQL server.
I have a form that maintains data in a Parent Header Table while displaying data via a ListView from a Child Detail Table. The listview has various features such as Hover and a double-click event that opens a popup dialog form to edit its data.
While editing the parent, I would like to 1) Gray out or give a clear appearance that the listview is disabled when the user clicks the cmdEdit button. 2) Disable the click event. <Edit: I still want to display the rows.>
Pretty sure that it can not be done using built-in features of the listview, but what if I could put a transparent control over the listview so that it is still visible but in the back so it can not be clicked?
When finished editing the parent and the user clicks the cmdSave button, then the listview is restored of its functions.
My project is ADP, my form is UnBound using ADO connection to a SQL server.
Code:
Private Sub BuildEnrollList()
On Error GoTo BuildEnrollList_Error
With Me.lvwEnrollment
'Set ListView style
.View = lvwReport
.LabelEdit = lvwManual
.Width = 8999
.HideSelection = False
.GridLines = True
.FullRowSelect = True
'Clear Header and ListItems
.ListItems.Clear
.ColumnHeaders.Clear
End With
'Set up column headers
With Me.lvwEnrollment.ColumnHeaders
.Add , , " ", 0, lvwColumnLeft
.Add , , "E-Date", 1075, lvwColumnLeft
.Add , , "Program Number", 1450, lvwColumnLeft
.Add , , "Program Type", 1190, lvwColumnLeft
.Add , , "Counselor", 985, lvwColumnLeft
.Add , , "Discharge", 1075, lvwColumnLeft
.Add , , "Status Code", 3101, lvwColumnLeft
.Add , , "Aord", 0, lvwColumnLeft
.Add , , "ArchStatus", 0, lvwColumnRight
End With
On Error GoTo 0
Exit Sub
BuildEnrollList_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure BuildEnrollList of VBA Document Form_frmProfile"
End Sub