I have the following code:

vb Code:
  1. strSQL = strSQL & "WHERE MerchantID in ("
  2.         For f = 0 To lstMerchants.ListCount - 1
  3.        
  4.         If lstMerchants.Selected(f) Then
  5.                     strSQL = strSQL & (lstMerchants.ItemData(f)) & ","
  6.            
  7.             End If
  8.        
  9.         Next f
  10.         strSQL = strSQL & ")"

At the moment, it lists merchants in a listbox and allows the user can select as many merchants as desired. It worked well in Access and there was no probs, but when trying against a SQL database the trailing comma throws the query. If the user selects one record, then no comma, and also shouldn't be a comma on the last selected merchant. I've tried SelCount but couldn't figure out the best way to use it.

I'm sure its simple but whats the best way to counteract this problem?

Thanks in advance!