Results 1 to 7 of 7

Thread: Micro Form Physician database

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Indiana,PA,USA
    Posts
    217

    Micro Form Physician database

    Hi all,
    Have anyone of you heared about this?I am not.
    My client want to use this database for storing patient information.

    Dose any one of you have example to retreive names of a patient from database,when you enter a initial in the text field?

    Like in Microsoft Outlook if you enter "M" it will show you all posible names starting with M in alphabetic order.

    Let me know if you don't understand.

    Thanks.
    Sudha

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Indiana,PA,USA
    Posts
    217

    I think,I need to modify my question.

    Forget about Micro form Physician Database.

    Assume I am using Oracle or Mysql databse.
    Now I want to display all possible names from datase when user enters Intial of a letter.Like Microsoft outlook,if you enetr "M" ,it will show you all possible Names starting with "M".
    Same search I want to do in VB.Is there any example out there?


    Sudha

  3. #3
    Hyperactive Member
    Join Date
    Nov 2001
    Location
    Albany, NY
    Posts
    489

    textdown

    on the TextBox_KeyDown event query your database
    comparing the

    str(Keycode) to the Left(DBField, 1)
    if it is equal then ADD to a list or combobox

    you might want to UCase both to make sure
    they match.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Indiana,PA,USA
    Posts
    217
    Any example would be helpful to me.

    Regards.
    Sudha

  5. #5
    Hyperactive Member
    Join Date
    Nov 2001
    Location
    Albany, NY
    Posts
    489

    SQL example

    put this in the Keydown event of your textbox


    Sub txtName_KeyDown(KeyCode As Integer, _
    Shift As Integer)

    Dim strName as String

    If DataEnvironment1.rsNames.State = adStateClosed Then
    DataEnvironment1.rsNames.Open
    End If

    If DataEnvironment1.rsNames.RecordCount > 0 Then
    DataEnvironment1.rsNames.MoveFirst
    Do While Not DataEnvironment1.rsNames.EOF

    strName = DataEnvironment1.rsNames.Fields("LastName")

    If str(KeyCode) = Left(strName,1) Then
    Me.ComboBox1.AddItem(strName)
    Endif

    DataEnvironment1.rsName.MoveNext
    Loop
    End If

    If DataEnvironment1.rsName.State = adStateOpen Then
    DataEnvironment1.rsName.Close
    End If

    End Sub

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Indiana,PA,USA
    Posts
    217
    Can you explain me about DataEnvironment1 and adStateClosed
    words?.Are they VB keywords or just variables?

    I am beginner to database Programming with VB.

    Please be patient with me and I will appreciate if you explain me whole code.

    Regards.
    Sudha

  7. #7
    Hyperactive Member
    Join Date
    Nov 2001
    Location
    Albany, NY
    Posts
    489
    the dataenvironment connects you to the database

    If you don't know much about connecting to the database
    there is a post about "Building a login screen" that describes
    some vague details. There are resources in the MSDN you can
    lookup for more info.

    adstateclosed just checks the status of the table.
    is it open or closed?

    There is a lot to cover, i would suggest checking the post and
    the msdn

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