VB2005: Error Using a Separate Search Form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anne DeBlois

    #1

    VB2005: Error Using a Separate Search Form

    I am working on a form (details) and I need my form to allow to search on
    some char fields.

    I have a button next to the field users can search. The button calls a
    pop-up form to enter the string to search.

    ItemsTableAdapt er is the table adapter used for the form.

    I have 1863 records in the Items table. My goal is to show only the records
    matching the string using the same form.

    I have modified the DataSet to add a query using a parameter:
    SELECT No, Type, ..... Interest3 FROM items where nm_latin like
    @srch_nm_latin order by nm_latin

    This code is executed when I return from the pop-up. The string contain a
    string. Example: "thing%"

    If (String.IsNullO rEmpty(Me.Reche rche.Text) = False) Then
    Dim rech_str As String = Me.Recherche.Te xt
    Me.ItemsTableAd apter.ClearBefo reFill = True
    Me.ItemsTableAd apter.FillBy_nm _latin(Me.Signs DataSet.items,
    rech_str)
    End If

    Once this code has executed, the BindingNavigato rchangedItem function is
    called and I need to get the key values I am not displaying in the form:

    ' Load the key values in the form field variables
    If
    (Me.SignsDataSe t.items.Rows(Me .ItemsBindingSo urce.Position). IsNull("No") =
    False) Then
    Me.NoKey =
    Me.SignsDataSet .items.Rows(Me. ItemsBindingSou rce.Position).I tem("No") '
    ERROR
    Else
    Me.NoKey = 0
    End If

    I have seen examples where a new TableAdapter is used for search. I don't
    know how I could do that since my form is all built on the
    ItemsTableAdapt er.

    Any hint on how to do this will be appreciated.


  • Kevin Yu [MSFT]

    #2
    RE: VB2005: Error Using a Separate Search Form

    Hi Anne,

    I noticed in your code, you're using Me.SignsDataSet .items.Rows. Is items
    table in the DataSet? If so, could you let me know the error message? Is it
    a build error or runtime error?

    Kevin Yu
    Microsoft Online Community Support

    =============== =============== =============== =====
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscripti...ult.aspx#notif
    ications.
    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscripti...t/default.aspx.
    =============== =============== =============== =====

    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Comment

    Working...