F
Fay Yocum
On loading of a form I have a datagrid loaded, If there is only one person
in the database I want that record to automatically be selected. I used this
code and it works.At least the one row is highlighted.
If Me.BindingContext(DsPerson1, "tblPerson").Count = 1 Then
DataGrid1.Select(0)
End If
Prior to including this code I had the following code on the open click
event.
If PK = 0 Then
MsgBox("You must select a person, then click Open.")
PK indicates that no record has been selected hence the 0.
My problem is that I get the message box even though the above code
apparently had selected the one and only record.
Any ideas? Thank you for your time.
Fay
in the database I want that record to automatically be selected. I used this
code and it works.At least the one row is highlighted.
If Me.BindingContext(DsPerson1, "tblPerson").Count = 1 Then
DataGrid1.Select(0)
End If
Prior to including this code I had the following code on the open click
event.
If PK = 0 Then
MsgBox("You must select a person, then click Open.")
PK indicates that no record has been selected hence the 0.
My problem is that I get the message box even though the above code
apparently had selected the one and only record.
Any ideas? Thank you for your time.
Fay