G
Guest
Only one row will be selected from a combo box. I need the 3rd value in the
row.
Is there a simpler way then using the for-next loop? Is ItemsSelected and
ItemData the only way to do this?
I'm looking to extract records between a date range for a specific payee.
Payto is the combo box. Here's how I'm doing it now. Thanks.
Private Sub db_betw_dates_obj_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
Dim payto As Control, varItm As Variant
For Each varItm In payto.ItemsSelected
strSQL = "SELECT * FROM RONCHECK_access " _
& "WHERE (((RONCHECK_access.DATE) Between " _
& Format(start_date_cal.Value, "\#mm\/dd\/yyyy\#") & " And " & Format
(end_date_cal.Value, "\#mm\/dd\/yyyy\#") & " And RONCHECK_access.PAYEE =
payto.ItemData(varItm));"
Next varItm
Me.db_betw_dates_obj.RowSource = strSQL
'Set rs = db.OpenRecordset(strSQL)
End Sub
row.
Is there a simpler way then using the for-next loop? Is ItemsSelected and
ItemData the only way to do this?
I'm looking to extract records between a date range for a specific payee.
Payto is the combo box. Here's how I'm doing it now. Thanks.
Private Sub db_betw_dates_obj_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
Dim payto As Control, varItm As Variant
For Each varItm In payto.ItemsSelected
strSQL = "SELECT * FROM RONCHECK_access " _
& "WHERE (((RONCHECK_access.DATE) Between " _
& Format(start_date_cal.Value, "\#mm\/dd\/yyyy\#") & " And " & Format
(end_date_cal.Value, "\#mm\/dd\/yyyy\#") & " And RONCHECK_access.PAYEE =
payto.ItemData(varItm));"
Next varItm
Me.db_betw_dates_obj.RowSource = strSQL
'Set rs = db.OpenRecordset(strSQL)
End Sub