select rowsource problem (1 Viewer)

bbwolff

Registered User.
Local time
Today, 10:17
Joined
Oct 1, 2013
Messages
116
i have unbound combobox, to chose from a list of ppl

SELECT [name] & " " & [surname] AS Expr1, tblPpl.user FROM tblPpl ORDER BY tblPpl.UserType, tblPpl.user.Surname;

i want to add a button, that would change the default order from name+surname to surname + name

sthg like

me.combobox.rowsouce = ...

i have problems with adding the expression to this row
 

namliam

The Mailman - AWF VIP
Local time
Today, 10:17
Joined
Aug 11, 2003
Messages
11,695
me.combobox.rowsouce = "SELECT [surname] & "" "" & [name] AS Expr1, tblPpl.user FROM tblPpl ORDER BY tblPpl.UserType, tblPpl.user.Surname; "

Like that!
 

bbwolff

Registered User.
Local time
Today, 10:17
Joined
Oct 1, 2013
Messages
116
perfect, tx
guess i missed " or two :D
 

namliam

The Mailman - AWF VIP
Local time
Today, 10:17
Joined
Aug 11, 2003
Messages
11,695
Thing is the single quotes start and end the string...
The double qoutes escape the string and force the quotes inside the string. ending up with the SQL you are looking for
 

Users who are viewing this thread

Top Bottom