|
-
Jul 20th, 2004, 08:55 AM
#1
Thread Starter
Addicted Member
Searching dataset hangs screen
Hi all,
i have a function which opens a new screen and tries to search through the dataset to find a specific record. The form opens but it hangs, what am i doing wrong?
VB Code:
Public Function Add_New()
Dim frmNS As New frmNS
frmNS.Show()
Try
Do While frmNS.objdsCDets_SDets.CDets(0).CHD_ID() <> sv
frmNS.BindingContext(frmNS.objdsCDets_SDets, "ChD").Position = (frmNS.BindingContext(frmNS.objdsCDets_SDets, "ChD").Position + 1)
Loop
Catch ex As Exception
MsgBox("Error", MsgBoxStyle.OKOnly)
End Try
End Function
'where sv contains the pk from the previous form
Cheers
-
Jul 20th, 2004, 10:23 AM
#2
Have you stepped through the code?
How large is the dataset?
-
Jul 20th, 2004, 10:38 AM
#3
Thread Starter
Addicted Member
It only has a dozen or so records, i have checked that the correct key has been selected by outputting the value to a message box. The problem appears to be when it tries to step through to match up sv with CH_ID.
I have managed to get it to jump to the correct record by putting a combobox and setting the value when the form opens.
combobox.selectedvalue = sv
this works but it doesn't appear to be the best way to do it!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|