Sub Cell_Click
If ThereIsOneCellSelected Then
Dim rc As RowCol
Dim l As Label
l = Sender
l.Color = CellColor
ThereIsOneCellSelected = False
Else
Dim rc As RowCol
Dim l As Label
SR = rc.Row
SC = rc.Col
ThereIsOneCellSelected = True
l = Sender
rc = l.Tag
getBookColour = l.Text
SelectRow(rc)
Activity.Title = l.text & " " & GetRecordNumber
End If
End Sub
My table has 5 column 0 to 4 Using Cell_Click I can easily retrieve the data in the cell '2' as in l.text and calling a modified SelectRow I change the colour of the selected cell. The "ThereIsOneCellSelected" is to allow me to use the same buttons for different functions.
I am struggling to find a way of getting the data from another cell on the same row, row 0.
Sub SelectRow(rc As RowCol)
Dim col As Int
Dim k As Label
'Removes the color of previously selected row
If SelectedRow > -1 Then
For col = 0 To NumberOfColumns - 1
Getview(SelectedRow, col).Color = CellColor
Next
End If
SelectedRow = rc.Row
'Sets the color of the selected row and selected cell
Getview(rc.Row, 2).Color = SelectedCellColor
k = Getview(SelectedRow,0)
GetRecordNumber = k.text
Activity.Title = getBookColour & " at " & GetRecordNumber
End Sub
Although I've called the variable GetRecordNumber it is a reference to the Catalogue Number in my db. However, what this code retreives is the row number in terms of the recordset it is working with, not the data actually in the cell.
I need that data so I can call an update routine to change the value of the 'book' in the db.
It would be wonderful if we could could change the Sender value so it would reference the cell two columns back
If ThereIsOneCellSelected Then
Dim rc As RowCol
Dim l As Label
l = Sender
l.Color = CellColor
ThereIsOneCellSelected = False
Else
Dim rc As RowCol
Dim l As Label
SR = rc.Row
SC = rc.Col
ThereIsOneCellSelected = True
l = Sender
rc = l.Tag
getBookColour = l.Text
SelectRow(rc)
Activity.Title = l.text & " " & GetRecordNumber
End If
End Sub
My table has 5 column 0 to 4 Using Cell_Click I can easily retrieve the data in the cell '2' as in l.text and calling a modified SelectRow I change the colour of the selected cell. The "ThereIsOneCellSelected" is to allow me to use the same buttons for different functions.
I am struggling to find a way of getting the data from another cell on the same row, row 0.
Sub SelectRow(rc As RowCol)
Dim col As Int
Dim k As Label
'Removes the color of previously selected row
If SelectedRow > -1 Then
For col = 0 To NumberOfColumns - 1
Getview(SelectedRow, col).Color = CellColor
Next
End If
SelectedRow = rc.Row
'Sets the color of the selected row and selected cell
Getview(rc.Row, 2).Color = SelectedCellColor
k = Getview(SelectedRow,0)
GetRecordNumber = k.text
Activity.Title = getBookColour & " at " & GetRecordNumber
End Sub
Although I've called the variable GetRecordNumber it is a reference to the Catalogue Number in my db. However, what this code retreives is the row number in terms of the recordset it is working with, not the data actually in the cell.
I need that data so I can call an update routine to change the value of the 'book' in the db.
It would be wonderful if we could could change the Sender value so it would reference the cell two columns back