|
-
Dec 14th, 2001, 09:41 AM
#1
Thread Starter
Addicted Member
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.
-
Dec 14th, 2001, 09:53 AM
#2
Thread Starter
Addicted Member
-
Dec 14th, 2001, 10:10 AM
#3
Hyperactive Member
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.
-
Dec 14th, 2001, 10:12 AM
#4
Thread Starter
Addicted Member
Any example would be helpful to me.
Regards.
-
Dec 14th, 2001, 10:42 AM
#5
Hyperactive Member
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
-
Dec 14th, 2001, 11:33 AM
#6
Thread Starter
Addicted Member
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.
-
Dec 14th, 2001, 12:02 PM
#7
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|