Search button help please!!!!

Hi there
The coding for my project looks as follows.

Private MemberDetail1AL As New ArrayList
Private M01Member001Info As New MPF.PAS.Contributions.M01Member001Info
Private MemberConsInfoController As New PAS.Contributions.MemberConsInfoController



If txtRunNumber.Text <> "" Then
MemberDetail1AL = MemberConsInfoController.GetMemberInfo (txtRunNumber.Text)
dtgTest.DataSource = MemberDetail1AL
M01Member001Info = MemberDetail1AL.Item(0)
End If



'THESE ARE THE BINDINGS FOR Member Detail(M01/002/001)

txtIndustryNumber3.DataBindings.Add("Text",M01Member001Info, "IndustryReference")
txtIdentityNumber3.DataBindings.Add
("Text", M01Member001Info, "IDNumber")
txtDateOfBirth3.DataBindings.Add
("Text", M01Member001Info, "BirthDate")
txtSurname.DataBindings.Add
("Text", M01Member001Info, "Surname")
txtInitials.DataBindings.Add
("Text", M01Member001Info, "Initials")
txtFirstName1.DataBindings.Add
("Text", M01Member001Info, "FirstName1")
txtFirstName2.DataBindings.Add
("Text", M01Member001Info, "FirstName2")
txtFirstName3.DataBindings.Add
("Text", M01Member001Info, "FirstName3")
txtTitle.DataBindings.Add
("Text", M01Member001Info, "Title")
txtLanguage.DataBindings.Add
("Text", M01Member001Info, "Language")
txtGender.DataBindings.Add
("Text", M01Member001Info, "Gender")
txtMaritalStatus.DataBindings.Add
("Text", M01Member001Info, "MaritalStatus")
txtPassportNumber.DataBindings.Add
("Text", M01Member001Info, "PassportReference")
txtPopulationGroup.DataBindings.Add
("Text", M01Member001Info, "PopulationGroup")


I also have a txtRunNumber textbox and a Search button , now I would like it if i could enter my run number in this text box and when i click my search button it will return all the relevant values in the text boxes i have binded.Any suggestions as the if statement i have written doesnt really do the trick.Also how can i stop it form bombing out if lets say i enter a run number that does not exist.

Kind Regards.





Comments

  • : Hi there
    : The coding for my project looks as follows.
    :
    : Private MemberDetail1AL As New ArrayList
    : Private M01Member001Info As New MPF.PAS.Contributions.M01Member001Info
    : Private MemberConsInfoController As New PAS.Contributions.MemberConsInfoController
    :
    :
    :
    : If txtRunNumber.Text <> "" Then
    : MemberDetail1AL = MemberConsInfoController.GetMemberInfo (txtRunNumber.Text)
    : dtgTest.DataSource = MemberDetail1AL
    : M01Member001Info = MemberDetail1AL.Item(0)
    : End If
    :
    :
    :
    : 'THESE ARE THE BINDINGS FOR Member Detail(M01/002/001)
    :
    : txtIndustryNumber3.DataBindings.Add("Text",M01Member001Info, "IndustryReference")
    : txtIdentityNumber3.DataBindings.Add
    : ("Text", M01Member001Info, "IDNumber")
    : txtDateOfBirth3.DataBindings.Add
    : ("Text", M01Member001Info, "BirthDate")
    : txtSurname.DataBindings.Add
    : ("Text", M01Member001Info, "Surname")
    : txtInitials.DataBindings.Add
    : ("Text", M01Member001Info, "Initials")
    : txtFirstName1.DataBindings.Add
    : ("Text", M01Member001Info, "FirstName1")
    : txtFirstName2.DataBindings.Add
    : ("Text", M01Member001Info, "FirstName2")
    : txtFirstName3.DataBindings.Add
    : ("Text", M01Member001Info, "FirstName3")
    : txtTitle.DataBindings.Add
    : ("Text", M01Member001Info, "Title")
    : txtLanguage.DataBindings.Add
    : ("Text", M01Member001Info, "Language")
    : txtGender.DataBindings.Add
    : ("Text", M01Member001Info, "Gender")
    : txtMaritalStatus.DataBindings.Add
    : ("Text", M01Member001Info, "MaritalStatus")
    : txtPassportNumber.DataBindings.Add
    : ("Text", M01Member001Info, "PassportReference")
    : txtPopulationGroup.DataBindings.Add
    : ("Text", M01Member001Info, "PopulationGroup")
    :
    :
    : I also have a txtRunNumber textbox and a Search button , now I would like it if i could enter my run number in this text box and when i click my search button it will return all the relevant values in the text boxes i have binded.Any suggestions as the if statement i have written doesnt really do the trick.Also how can i stop it form bombing out if lets say i enter a run number that does not exist.
    :
    : Kind Regards.
    :
    :
    :
    :
    :
    :

    [blue] Are you loading these from a record set? In your bindings are each of them seperate tables? (IDNumber, FirstName, etc) If not you normally need to refer to the table and specific field the control is bound to: [red]Table[/red].IDNumber, etc.

    You can either put a [green]Try / Catch[/green] on the button click to catch any errors or make your [red] If txtRunNumber.Text <> "" Then[/red] a [green] If/ Then / Else[/green] statement.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion