[FONT="]Can anyone help with ORDER BY problem please. [/FONT]
[FONT="] [/FONT]
[FONT="]The following Function resides in an Access 16 Module[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Public Function ShowTrainingHistory(intJobNo As Integer)[/FONT]
[FONT="]Dim strTrainingHistory As String[/FONT]
[FONT="] [/FONT]
[FONT="] strTrainingHistory = "SELECT Training_date, SubjectToday, Training_ID, Job_No FROM tblSubjectToday WHERE [Job_No]= " & intJobNo[/FONT]
[FONT="] [/FONT]
[FONT="]'Now assign the Training History of the selected Client to the Training History List on the frmTraining Form.[/FONT]
[FONT="] [/FONT]
[FONT="] Forms("frmClient").[subTraining].Form.lstTrainingHistory.RowSource = strTrainingHistory[/FONT]
[FONT="] [/FONT]
[FONT="]End Function[/FONT]
The code works fine and populates the ListBox, but I want the List to be ordered by Training_date and I just can’t seem to position a ORDER BY Training_date clause in the string without displaying an error. Any help appreciated :banghead:
:banghead:
[FONT="] [/FONT]
[FONT="]The following Function resides in an Access 16 Module[/FONT]
[FONT="] [/FONT]
[FONT="] [/FONT]
[FONT="]Public Function ShowTrainingHistory(intJobNo As Integer)[/FONT]
[FONT="]Dim strTrainingHistory As String[/FONT]
[FONT="] [/FONT]
[FONT="] strTrainingHistory = "SELECT Training_date, SubjectToday, Training_ID, Job_No FROM tblSubjectToday WHERE [Job_No]= " & intJobNo[/FONT]
[FONT="] [/FONT]
[FONT="]'Now assign the Training History of the selected Client to the Training History List on the frmTraining Form.[/FONT]
[FONT="] [/FONT]
[FONT="] Forms("frmClient").[subTraining].Form.lstTrainingHistory.RowSource = strTrainingHistory[/FONT]
[FONT="] [/FONT]
[FONT="]End Function[/FONT]
The code works fine and populates the ListBox, but I want the List to be ordered by Training_date and I just can’t seem to position a ORDER BY Training_date clause in the string without displaying an error. Any help appreciated :banghead:
:banghead: