G
Guest
I have a button on a form performing a query, using data from the form to go
into the "Criteria" argument of the Query. Does this even seem like I'm
getting close? New to VBA for Access, but old to VBA. Thanks.
Option Explicit:
Private Sub CmdTirtlQry_Click()
Dim datBegin As Date
Dim strBegTime As String
Dim datEnd As Date
Dim strEndTime As String
datBegin = List14.Value 'value from the listbox
datEnd = List18.Value
strBegTime = List16.Value
strEndTime = List20.Value
Query!tirtltest.Filter = "[date]=#" & datBegin & "#"
Query!tirtltest.FilterOn = True
End Sub
Of course I would try and filter using all the variables, but I hope someone
can point me in the right direction.
into the "Criteria" argument of the Query. Does this even seem like I'm
getting close? New to VBA for Access, but old to VBA. Thanks.
Option Explicit:
Private Sub CmdTirtlQry_Click()
Dim datBegin As Date
Dim strBegTime As String
Dim datEnd As Date
Dim strEndTime As String
datBegin = List14.Value 'value from the listbox
datEnd = List18.Value
strBegTime = List16.Value
strEndTime = List20.Value
Query!tirtltest.Filter = "[date]=#" & datBegin & "#"
Query!tirtltest.FilterOn = True
End Sub
Of course I would try and filter using all the variables, but I hope someone
can point me in the right direction.