Hi,
I am struggling with a certain problem and I need some help.
I am using the code below to populate a window with the details in the SELECTED ListBox row.
if Window1.TextFieldOpen.Text = "false" then
if lb_accounts.ListIndex = -1 Then
MsgBox("You have not selected an entry to edit or delete!")
else
EditIncomeWindow.ShowModal
end if
end if
It works perfectly, but I now need to adapt it so that if column 5 of the SELECTED row is empty, then open EditExpensesWindow, if not empty, then open EditIncomeWindow.
Would someone be so kind enough as to help me, as I have got myself totally muddled up
// instead of the line
// EditIncomeWindow.ShowModal
// put this:
If lb_accounts.Cell(lb_accounts.ListIndex, 5) = "" Then
EditExpensesWindow.ShowModal()
Else
EditIncomeWindow.ShowModal()
End
Whoops - tried that code but it only opens the EditExpenseWindow - even if there is text in column 5.
My code looks like this:
if Window1.TextFieldOpen.Text = "false" then
if lb_accounts.ListIndex = -1 Then
MsgBox("You have not selected an entry to edit or delete!")
else
If lb_accounts.Cell(lb_accounts.ListIndex, 5) = "" Then
EditExpensesWindow.ShowModal()
Else
EditIncomeWindow.ShowModal()
End
end if
end if