By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,571 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,571 IT Pros & Developers. It's quick & easy.

Selection issue

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Fay Yocum" <fy****@REMOVEix.netcom.com> wrote...

Hi Fay,
My problem is that I get the message box even though the above code
apparently had selected the one and only record.


I think it depends upon how PK is getting set and from the sounds of it, it
isn't getting set... but rather than set PK perhaps you can reference
DataGrid1.CurrentCell.RowNumber()

Tom
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.