N
Neil
Hi,
I am using the following code in the after update event of a combo box
[cboregion] to sync another combo box [Combo5], it all works except when the
first "if" is true it doesn't sort the salesman. I have tried putting the
ORDER BY[Salesman] in but cannot get it to work.
I am stumped on how to sort by salesman and help would be appreciated
Dim sSource As String
If Me.cboRegion.Value <> 10 Then
sSource = "SELECT [tblsalesman].[ID], [tblsalesman].[region],
[tblsalesman].[salesman] " & _
"FROM tblSalesman " & _
"WHERE [region] = " & Me.cboRegion.Value
Me.Combo5.RowSource = sSource
Else
Me.Combo5.RowSource = "SELECT [tblsalesman].[ID],
[tblsalesman].[Region], [tblsalesman].[salesman] FROM tblSalesman ORDER BY
[Salesman]"
End If
Me.Combo5.Requery
thanks in advance
Neil
I am using the following code in the after update event of a combo box
[cboregion] to sync another combo box [Combo5], it all works except when the
first "if" is true it doesn't sort the salesman. I have tried putting the
ORDER BY[Salesman] in but cannot get it to work.
I am stumped on how to sort by salesman and help would be appreciated
Dim sSource As String
If Me.cboRegion.Value <> 10 Then
sSource = "SELECT [tblsalesman].[ID], [tblsalesman].[region],
[tblsalesman].[salesman] " & _
"FROM tblSalesman " & _
"WHERE [region] = " & Me.cboRegion.Value
Me.Combo5.RowSource = sSource
Else
Me.Combo5.RowSource = "SELECT [tblsalesman].[ID],
[tblsalesman].[Region], [tblsalesman].[salesman] FROM tblSalesman ORDER BY
[Salesman]"
End If
Me.Combo5.Requery
thanks in advance
Neil