Hello All,
I've been working on a project for some time now - a ticket tracker to be precise. There are three fields in the table:
Initial Request Date
Followup Request Date
Ticket Identification Number
I've been trying to write VBA code that will retrieve the ticket numbers that were submitted in the last 24/48/All hours (Based on Optionboxes and a Command button). Those ticket numbers are to be sent to a listbox's rowsource for requery; however, I am unable to get the listbox to show any results.
Private Sub Command74_Click()
Dim Variable_Fol24 As String
Dim Variable_Fol48 As String
Dim Variable_Folall As String
Variable_Fol24 = "SELECT Tracker.TicketNumber, Tracker.[TicketNumber] FROM Tracker WHERE Tracker.[Initial] =< DATE_FORMAT(NOW(),'%Y%m%d')-1;"
Variable_Fol48 = "SELECT Tracker.TicketNumber, Tracker.[TicketNumber] FROM Tracker WHERE Tracker.[Initial] > DATE_FORMAT(NOW(),'%Y%m%d')-1;"
Variable_Folall = "SELECT TicketNumber FROM Tracker"
If Option58.DefaultValue = "10" Then List134.RowSource = Variable_Fol24
If Option60.DefaultValue = "10" Then List134.RowSource = Variable_Fol48
If Option63.DefaultValue = "10" Then List134.RowSource = Variable_Folall
Me.List134.Requery
MsgBox (List134.RowSource)
End Sub
The messagebox is just used to verify that the rowsource is passing over correctly, which it does.
So, I hope there is at least one guru out there that will graciously show me how to correct this code.
I've been working on a project for some time now - a ticket tracker to be precise. There are three fields in the table:
Initial Request Date
Followup Request Date
Ticket Identification Number
I've been trying to write VBA code that will retrieve the ticket numbers that were submitted in the last 24/48/All hours (Based on Optionboxes and a Command button). Those ticket numbers are to be sent to a listbox's rowsource for requery; however, I am unable to get the listbox to show any results.
Private Sub Command74_Click()
Dim Variable_Fol24 As String
Dim Variable_Fol48 As String
Dim Variable_Folall As String
Variable_Fol24 = "SELECT Tracker.TicketNumber, Tracker.[TicketNumber] FROM Tracker WHERE Tracker.[Initial] =< DATE_FORMAT(NOW(),'%Y%m%d')-1;"
Variable_Fol48 = "SELECT Tracker.TicketNumber, Tracker.[TicketNumber] FROM Tracker WHERE Tracker.[Initial] > DATE_FORMAT(NOW(),'%Y%m%d')-1;"
Variable_Folall = "SELECT TicketNumber FROM Tracker"
If Option58.DefaultValue = "10" Then List134.RowSource = Variable_Fol24
If Option60.DefaultValue = "10" Then List134.RowSource = Variable_Fol48
If Option63.DefaultValue = "10" Then List134.RowSource = Variable_Folall
Me.List134.Requery
MsgBox (List134.RowSource)
End Sub
The messagebox is just used to verify that the rowsource is passing over correctly, which it does.
So, I hope there is at least one guru out there that will graciously show me how to correct this code.