cken21
Technical User
- Oct 19, 2011
- 37
Hi,
I have a userform which collects data and stores it in a database, i have an report tab on the userform which collates the data between two dates. Currently it searches a managers number and returns the number of entries listed under that managers number. I would prefer if it searched by the managers name, could anyone suggest a change to the following code which would allow this?>
'Set Searchstring for Overall Feedback
Set rs = New ADODB.Recordset
searchstring = "SELECT * FROM FeedbackLog WHERE [Manager] = " & Pers & " AND [DateKeyed] >= " & DateFrom & " And [DateKeyed] <= " & DateTo
rs.Open searchstring, cn, adOpenStatic
totalFeedback = rs.RecordCount
tbItemsOfFeedback.Value = totalFeedback
Set rs = Nothing
I have a userform which collects data and stores it in a database, i have an report tab on the userform which collates the data between two dates. Currently it searches a managers number and returns the number of entries listed under that managers number. I would prefer if it searched by the managers name, could anyone suggest a change to the following code which would allow this?>
'Set Searchstring for Overall Feedback
Set rs = New ADODB.Recordset
searchstring = "SELECT * FROM FeedbackLog WHERE [Manager] = " & Pers & " AND [DateKeyed] >= " & DateFrom & " And [DateKeyed] <= " & DateTo
rs.Open searchstring, cn, adOpenStatic
totalFeedback = rs.RecordCount
tbItemsOfFeedback.Value = totalFeedback
Set rs = Nothing