How to display the field in text box using combo box. When the user click the combo box, two fields will be displayed, the first field will be displayed in 1st text box1 and 2nd field in text box2.
These are my codes. Can you help me how?
Dim cmdoff As ADODB.Command
Dim rsoff As ADODB.Recordset
Private Sub loadOffice()
Set cmdoff = New ADODB.Command
Set cmdoff.ActiveConnection = Conn
cmdoff.CommandText = "SP_POPULATE_OFFICECODE"
cmdoff.CommandType = adCmdStoredProc
Set rsoff = cmdoff.Execute
Combo1.Clear
With rsoff
.MoveFirst
Do While Not rsoff.EOF
Combo1.AddItem !Office_Code '& vbTab & !Office_Title
Text1.Text = !Office_Title
.MoveNext
Loop
End With
cmdoff.ActiveConnection = Nothing
End Sub
Private Sub Combo1_DropDown()
Call loadOffice
End Sub
Private Sub Form_Load()
con = OpenConnect(Conn)
End Sub