Hi guys,
Im in a bit of a position. I wrote some VBA which outputted the results of mysql to a listbox as per the below code:
Code:
Case "Current User"
MySQL = "SELECT TimesheetTable.sUser, TimesheetTable.Activity, TimesheetTable.Hours, TimesheetTable.Project, TimesheetTable.[Task Date], TimesheetTable.Description FROM TimesheetTable "
MySQL = MySQL & "WHERE ((TimesheetTable.sUser)= '" & [Forms]![TotalHours_Frm]![CurrentUser] & "') AND ((TimesheetTable.[Task Date])>=[Forms]![TotalHours_Frm]![TotalHours_Fromtxtbox] AND "
MySQL = MySQL & "(TimesheetTable.[Task Date])<=[Forms]![TotalHours_Frm]![TotalHours_Totxtbox]) AND ((TimesheetTable.Project) Like '*" & [Forms]![TotalHours_Frm]![ProjectRef_txtbox] & "*')"
Me.TotalHrs_Listbox.RowSourceType = "table/query"
Me.TotalHrs_Listbox.ColumnCount = "6"
Me.TotalHrs_Listbox.ColumnWidths = "3.5cm;3.5cm;1.50cm;6.5cm;2.25cm;7.5cm;"
Me.TotalHrs_Listbox.RowSource = MySQL
End Select
Is there an easy way to change the listbox to a subform and then carry on from where I left off? The reason being I am trying to tally a column not realising that the listbox wasnt the best option for this method.
Thanks in advance!!