How to make a code using dataenvironment search button?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • psyvanz
    New Member
    • Sep 2009
    • 26

    How to make a code using dataenvironment search button?

    *using dataenvironment

    *code in search button...

    *connect in ms access database 2003

    *can search all (not only one)"male" person or same surnames... that saved in a database...

    kindly post here.... the code.... thanks in advancee...

    if you have a site related to this.. kindly post here.. the link... anyway... thanks..

    and merry christmas and happy new year to all....
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    kindly post he code that you are working on.

    Comment

    • butaiba
      New Member
      • Jan 2010
      • 1

      #3
      Originally posted by debasisdas
      kindly post he code that you are working on.
      please i have the same problem with my VB the search for a name in my data environment plz help and here is the code:

      Private Sub Command2_Click( )
      y = InputBox(" enter the name plz ")
      If y = vbCancel Then
      Exit Sub
      ElseIf DataEnvironment 1.rsCommand1.Re cordCount = 0 Then
      MsgBox ("no data")
      ElseIf y <> "" Then
      DataEnvironment 1.rsCommand1.Mo veFirst
      DataEnvironment 1.rsCommand1.Fi nd "Name = '" & y & " ' "
      On Error GoTo picer
      x = "c:\pix\" + Text1.Text + ".jpg"
      Image3.Picture = LoadPicture(x)
      picer:
      Exit Sub
      If DataEnvironment 1.rsCommand1.EO F Then
      MsgBox ("not registed")
      DataEnvironment 1.rsCommand1.Mo veFirst
      End If
      End If
      End Sub

      Comment

      • smartchap
        New Member
        • Dec 2007
        • 236

        #4
        Dear butaiba
        I have not checked ur code but am correcting its syntax as below:

        Code:
        Private Sub Command2_Click()
        y = InputBox(" enter the name plz ")
        If y = vbCancel Then
        Exit Sub
        ElseIf DataEnvironment1.rsCommand1.RecordCount = 0 Then
        MsgBox ("no data")
        ElseIf y <> "" Then
        DataEnvironment1.rsCommand1.MoveFirst
        DataEnvironment1.rsCommand1.Find "Name = '" & y & " ' "
        On Error GoTo picer
        x = "c:\pix\" + Text1.Text + ".jpg"
        Image3.Picture = LoadPicture(x)
        If DataEnvironment1.rsCommand1.EOF Then
        MsgBox ("Not registered")
        Exit Sub
        Else
        DataEnvironment1.rsCommand1.MoveNext
        End If
        End If
        picer:
        End Sub
        Try above & if have any other problem, let me know. Also if u post ur full code, it will be easy to help u with perfect solution.

        Comment

        Working...