Order by in rowsource

  • Thread starter Thread starter deb
  • Start date Start date
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
 
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
 
Back
Top