|
-
Jul 13th, 2015, 10:46 PM
#1
Thread Starter
New Member
-
Jul 14th, 2015, 05:49 AM
#2
New Member
Re: How to autocomplete TextBoxs? (using ADODB and Access) [VB6]
Just call the recordset
-----------------------------
put this code in textbox1_change event
--------------------------------------------------------
dim getnames as recordset
set getnames=c.openrecordset("select <namefield from <tablename> where <idfield>=' " & textbox1.text & " ' ")
if getnames.recordcount>0 then
textbox2.text=getnames!namefiled
else
textbox2.text="No Data"
endif
' I hope you understand the concept
<[email protected]>
-
Jul 14th, 2015, 07:20 AM
#3
Thread Starter
New Member
Re: How to autocomplete TextBoxs? (using ADODB and Access) [VB6]
 Originally Posted by hameed
Just call the recordset
-----------------------------
put this code in textbox1_change event
--------------------------------------------------------
dim getnames as recordset
set getnames=c.openrecordset("select <namefield from <tablename> where <idfield>=' " & textbox1.text & " ' ")
if getnames.recordcount>0 then
textbox2.text=getnames!namefiled
else
textbox2.text="No Data"
endif
' I hope you understand the concept
< [email protected]>
 Originally Posted by hameed
Just call the recordset
-----------------------------
put this code in textbox1_change event
--------------------------------------------------------
dim getnames as recordset
set getnames=c.openrecordset("select <namefield from <tablename> where <idfield>=' " & textbox1.text & " ' ")
if getnames.recordcount>0 then
textbox2.text=getnames!namefiled
else
textbox2.text="No Data"
endif
Ok, I understood what you said so I did this:
Code:
Dim conexion As New ADODB.Connection
Dim getnames As New ADODB.Recordset
Private Sub Text2_Change()
Set getnames = New ADODB.Recordset
If Not Text2.Text = "" Then
getnames.Open "SELECT Herramienta FROM Herramientas WHERE idHerramienta=" & Text2.Text & "", conexion, adOpenStatic, adLockOptimistic
If getnames.RecordCount > 0 Then
Text3.Text = getnames!Herramienta
Else
Text3.Text = "No Data"
End If
End If
End Sub
and it works perfectly, thank you very much for your help!!!!
best regards
-
Jul 14th, 2015, 07:31 AM
#4
New Member
Re: How to autocomplete TextBoxs? (using ADODB and Access) [VB6]
you are welcome ,
any time you have any doubts pls contact, i will try to solve if its in my knowledge.
Tags for this Thread
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
|