timnicholls
Technical User
Hi all,
I am trying to pass a different set of names (clients or staff) to a single combobox given a selection of an option group.
I can get them to the combox if the query is simple. That is if there is nothing like SELECT [Surname] & ", " & [First Name]. But SELECT [Surname] FROM ... I can get to work, however its not what I want.
In the code below the first hurdle is (& ", " &) just after [Surname] in the first line.
The SQL is just from a query which works fine.
Can anybody help to get this SQL to work?
Thanks
I am trying to pass a different set of names (clients or staff) to a single combobox given a selection of an option group.
I can get them to the combox if the query is simple. That is if there is nothing like SELECT [Surname] & ", " & [First Name]. But SELECT [Surname] FROM ... I can get to work, however its not what I want.
In the code below the first hurdle is (& ", " &) just after [Surname] in the first line.
The SQL is just from a query which works fine.
Can anybody help to get this SQL to work?
Thanks
Code:
Private Sub Frame106_AfterUpdate()
Dim strSQL As String
If Me.Frame106 = 1 Then
strSQL= "SELECT [Surname] & ", " & [First Name] AS Client_Name, Clients.[First Name], Clients.Surname, Clients.Status FROM Clients WHERE (((Clients.Status) = "A")) ORDER BY [Surname];"
Me.Combo24.RowSource = strSQL
End If
If Me.Frame106 = 2 Then
strSQL = "SELECT Employees.[Surname],Employees.[First Name], Employees.[Status] FROM Employees WHERE (((Employees.Status) = "C" Or (Employees.Status) = "F" Or (Employees.Status) = "P")) ORDER BY [Surname] & ", " & [First Name];"
Me.Combo24.RowSource = strSQL
End If