Order by in rowsource

D

deb

Access 2003 - code in form current for combobox to show active and current
ContactID if it is not"active".

How do i add ORDER BY [ContactLName] & ", " & [ContactFName] to the below
code?

I've tried it several ways but no luck

Dim strSQLContactPMID As String
strSQLContactPMID = "SELECT ContactID, [ContactLName] & ', ' &
[ContactFName] " & _
"FROM t41Contacts " & _
"where (((t41Contacts.TitleMSP) In (48,49)) AND
((t41Contacts.ContactStatus)='active')) Or ContactID =" & Me.ContactPMID
Me.ContactPMID.RowSource = strSQLContactPMID
 
D

Duane Hookom

Try:

Dim strSQLContactPMID As String
strSQLContactPMID = "SELECT ContactID, [ContactLName] & ', ' &
[ContactFName] " & _
"FROM t41Contacts " & _
"where (TitleMSP In (48,49) AND ContactStatus='active') Or " & _
"ContactID =" & Me.ContactPMID & _
" ORDER BY ContactLName, ContactFName"
Me.ContactPMID.RowSource = strSQLContactPMID
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top