Smiley 3636
New member
- Local time
- Tomorrow, 03:42
- Joined
- Oct 15, 2023
- Messages
- 8
Hi
I have list box attached to a table i am trying to achieve a treeview output.
What i am trying to acheive is that when i click on the list box it shows the main category with the sub caategorys in view.
for example:
OVERVIEW
CHART OF ACCOUNTS
to
OVERVIEW
- Immediate window
- Lodgement
- protential Leads
CHART OF ACCOUNTS
but keep comeing with a run time error 3075
Private Sub List3_Click()
'MS ACCESS DETERMINE THE LISTBOX ITEM CLICKED ON CLICKED EVENT
Dim rowIndex As Integer
Dim rowValue As String, iMLBid As String, isub As String
Dim rowIsSelected As Integer
Dim result As String
Dim i2F As Double, i2E As Double
' ListBox row index clicked
rowIndex = Me.List3.ListIndex
' Row value clicked
rowValue = Me.List3.Column(0)
iMLBid = Me.List3.Column(1)
i2F = iMLBid + 0.01
i2E = iMLBid + 0.99
' If row is selected return value is -1, if unselected return value 0
rowIsSelected = Me.List3.Selected(rowIndex)
If (rowIsSelected = -1) Then
result = rowValue & " selected"
'UPDATE dbtMenuSubList1 SET dbtMenuSubList1.CatSublist = True
'WHERE (((dbtMenuSubList1.MLBID) Between 1.01 And 1.99));
CurrentDb.Execute " UPDATE [dbtMenuSubList1] SET [dbtMenuSubList1].[CatSublist] = False " _
& " FROM [dbtMenuSubList1] WHERE ((([dbtMenuSubList1].[MLBID]) Between [iMLBid] >=i2F-1 and [iMLBid]<= i2E));"
Else
result = rowValue & " unselected"
'the selected boolean boxes on the table are true otherwise false
CurrentDb.Execute " UPDATE [dbtMenuSubList1] SET [dbtMenuSubList1].[CatSublist] = -1 " _
& " FROM [dbtMenuSubList1] WHERE ((([dbtMenuSubList1].[MLBID]) Between 'i2F' and 'i2E'));"
End If
End Sub
I have list box attached to a table i am trying to achieve a treeview output.
What i am trying to acheive is that when i click on the list box it shows the main category with the sub caategorys in view.
for example:
OVERVIEW
CHART OF ACCOUNTS
to
OVERVIEW
- Immediate window
- Lodgement
- protential Leads
CHART OF ACCOUNTS
but keep comeing with a run time error 3075
Private Sub List3_Click()
'MS ACCESS DETERMINE THE LISTBOX ITEM CLICKED ON CLICKED EVENT
Dim rowIndex As Integer
Dim rowValue As String, iMLBid As String, isub As String
Dim rowIsSelected As Integer
Dim result As String
Dim i2F As Double, i2E As Double
' ListBox row index clicked
rowIndex = Me.List3.ListIndex
' Row value clicked
rowValue = Me.List3.Column(0)
iMLBid = Me.List3.Column(1)
i2F = iMLBid + 0.01
i2E = iMLBid + 0.99
' If row is selected return value is -1, if unselected return value 0
rowIsSelected = Me.List3.Selected(rowIndex)
If (rowIsSelected = -1) Then
result = rowValue & " selected"
'UPDATE dbtMenuSubList1 SET dbtMenuSubList1.CatSublist = True
'WHERE (((dbtMenuSubList1.MLBID) Between 1.01 And 1.99));
CurrentDb.Execute " UPDATE [dbtMenuSubList1] SET [dbtMenuSubList1].[CatSublist] = False " _
& " FROM [dbtMenuSubList1] WHERE ((([dbtMenuSubList1].[MLBID]) Between [iMLBid] >=i2F-1 and [iMLBid]<= i2E));"
Else
result = rowValue & " unselected"
'the selected boolean boxes on the table are true otherwise false
CurrentDb.Execute " UPDATE [dbtMenuSubList1] SET [dbtMenuSubList1].[CatSublist] = -1 " _
& " FROM [dbtMenuSubList1] WHERE ((([dbtMenuSubList1].[MLBID]) Between 'i2F' and 'i2E'));"
End If
End Sub