Results 1 to 3 of 3

Thread: Searching dataset hangs screen

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129

    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:
    1. Public Function Add_New()
    2.  
    3.         Dim frmNS As New frmNS
    4.         frmNS.Show()
    5.  
    6.         Try
    7.             Do While frmNS.objdsCDets_SDets.CDets(0).CHD_ID() <> sv
    8.                 frmNS.BindingContext(frmNS.objdsCDets_SDets, "ChD").Position = (frmNS.BindingContext(frmNS.objdsCDets_SDets, "ChD").Position + 1)
    9.             Loop
    10.  
    11.         Catch ex As Exception
    12.             MsgBox("Error", MsgBoxStyle.OKOnly)
    13.         End Try
    14.  
    15. End Function
    16.  
    17. 'where sv contains the pk from the previous form

    Cheers

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Have you stepped through the code?

    How large is the dataset?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129
    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
  •  



Click Here to Expand Forum to Full Width