Note that there are some explanatory texts on larger screens.

plurals
  1. POsplit text from combo box to textboxes and display their relevent information
    primarykey
    data
    text
    <pre><code>Private Sub Cmbfullname_Click() Dim SQL As String Dim FName, SName, LName As String FName = Mid(Combo14.Text, 1, InStr(1, Combo14.Text, " ", vbTextCompare)) SQL = "SELECT A.ROLLNO,A.FIRST_NAME,A.MIDDLE_NAME,A.LAST_NAME,A.CONTACT,A.CONTACT1,A.CONTACT2,A.ADDRESS,A.GRADE,B.DIV,A.BLOOD_GROUP,C.HOUSE,A.DATE_OF_BIRTH,A.TRANSPORT,A.SNAME,A.MEAL,A.BUSNO,A.RUTNO,D.DNAME,D.DCONT,E.ANM,D.DADD,A.CARD_TYPE,A.CARD_NO FROM STUDENT_RECORD_DATABASE A,DIVISION B,HNM C,DRIVER D,ATTEND E WHERE A.DIVID=B.DIVID AND A.HID=C.HID AND A.DID=D.DID AND A.AID=E.AID AND " SQL = SQL + "FIRST_NAME='" &amp; FName &amp; "'" Set RES = CON.Execute(SQL) If RES.RecordCount &gt; 0 Then RES.MoveFirst COMBO4.Text = RES!ROLLNO Text2.Text = RES!FIRST_NAME Text3.Text = RES!MIDDLE_NAME Text4.Text = RES!LAST_NAME Text5.Text = RES!CONTACT Text6.Text = RES!CONTACT1 Text7.Text = RES!CONTACT2 Text8.Text = RES!ADDRESS Combo1.Text = RES!GRADE Combo2.Text = RES!DIV Combo3.Text = RES!BLOOD_GROUP Combo9.Text = RES!HOUSE DTPicker1.Value = RES!DATE_OF_BIRTH Combo10.Text = RES!TRANSPORT Combo5.Text = RES!SName Combo11.Text = RES!MEAL Combo6.Text = RES!BUSNO Combo12.Text = RES!RUTNO Combo7.Text = RES!DNAME Text9.Text = RES!DCONT Combo8.Text = RES!ANM Text10.Text = RES!DADD Combo13.Text = RES!CARD_TYPE Text11.Text = RES!CARD_NO End If Exit Sub Private Sub Cmbfullname_LostFocus() Dim temp As Variant temp = Split(Combo14.Text, " ") If temp(0) &lt;&gt; Empty Then Combo14.Text = FIRST_NAME If UBound(temp) Then Text2.Text = temp(0) Else If UBound(temp) Then Text3.Text = temp(1) Else If UBound(temp) Then Text4.Text = temp(2) End If End If End If End If End Sub Private Sub Text2_LostFocus() //This code is repeated for text3 and text4 also Dim SQL As String Combo14.Clear Dim STR() As String STR = Split(Text2.Text, " ") If STR(0) &lt;&gt; Empty Then SQL = "SELECT * FROM STUDENT_RECORD_DATABASE WHERE FIRST_NAME='" &amp; STR(0) &amp; "'" Set RES = CON.Execute(SQL) If RES.RecordCount &gt; 0 Then RES.MoveFirst For I = 0 To RES.RecordCount - 1 Combo14.AddItem RES.Fields("FIRST_NAME").Value &amp; "" &amp; RES.Fields("MIDDLE_NAME").Value &amp; "" &amp; RES.Fields("LAST_NAME").Value RES.MoveNext Next End If Combo14.Text = STR(0) End If End Sub </code></pre> <p>Particularly this code shows records full name as entered first_name into text2,but when I select one of them it will just show info of first record only not for other selected record.same operation I want to perform using all of 3 text boxes.text4 is performing right operation but text2,text3 are not. thanx</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload