Hi. I was hoping someone can assit.
I have a search form. That searches various tables and show the result in multi selelct list box. The data shown in the list box is retreived via SQL.
I am hoping to change the way the data is being displayed in the list box.
Currently the order of my colums is in no order. I have the following code to display the data.
I currently have 6 Colums They Are
1. Id
2. Status
3. First Name
4. Surname
5. Current Status
6. Status Remark
And this is the order that i would like them to appear.
Even though i have changed where they are typed etc. They appear as
3. First Name
1. ID
2. Status
5. Current Status
6. Status Remark
4. Surname
I have added them to the order clause the way they should appear but still no order. Is there something i am possible missing.
Any advise would be appreciated.
Kind Regards
SN
I have a search form. That searches various tables and show the result in multi selelct list box. The data shown in the list box is retreived via SQL.
I am hoping to change the way the data is being displayed in the list box.
Currently the order of my colums is in no order. I have the following code to display the data.
Code:
Private Sub cmdOK_Click()
Dim rstPersonnel As ADODB.Recordset
Dim strSQL As String
Dim strSkillID As String
Dim strLocationWorked As String
Dim strLanguages As String
Dim varItem As Variant
Dim l As Long
On Error GoTo cmdOK_Click_Err
'----- Build SQL statement -----
strSQL = "SELECT DISTINCT PI.ID, PI.Status, PI.Surname, PI.[First Name],PI.[Status Current],PI.[Status Remark]" & _
"FROM ((tblPersonnelInfo PI " & _
"INNER JOIN tblPersonnelInfoSkills PIS " & _
"ON PI.ID = PIS.PersonID) " & _
"INNER JOIN tblPersonnelInfoWorkExp PIWE " & _
"ON PI.ID = PIWE.ID) " & _
"INNER JOIN tblPersonnelInfoLanguages PIL " & _
"ON PI.ID = PIL.ID " & _
"WHERE "
More code about searching
'----- The ordering clause -----
strSQL = strSQL & "ORDER BY PI.ID "
Set rstPersonnel = New ADODB.Recordset
rstPersonnel.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly, adCmdText
Set Me.lstPersonnel.Recordset = rstPersonnel
cmdOK_Click_Exit:
DoCmd.Echo True
Exit Sub
I currently have 6 Colums They Are
1. Id
2. Status
3. First Name
4. Surname
5. Current Status
6. Status Remark
And this is the order that i would like them to appear.
Even though i have changed where they are typed etc. They appear as
3. First Name
1. ID
2. Status
5. Current Status
6. Status Remark
4. Surname
I have added them to the order clause the way they should appear but still no order. Is there something i am possible missing.
Any advise would be appreciated.
Kind Regards
SN