I have a report which contains all data within a month, grouped by days. The report is embedded in a form which contain a textbox. I need to be able "scroll" the report to a specific date, which I select/enter in the textbox. I have tried different methods like GoToRecord, FindRecord, SetFilter, SearchForRecord etc. and I think SearchForRecord is close to what I need but something is missing and I don't know what.
This is the code I use:
Dim strFind As String
strFind = Format(Me.txtCStart, "Long Date", 0, 0)
Me.Child2.SetFocus
DoCmd.SearchForRecord , , acFirst, "[DATAED By Day] = 'strFind'"
Me.Child2.Report![DATAED By Day].SetFocus
This is the code I use:
Dim strFind As String
strFind = Format(Me.txtCStart, "Long Date", 0, 0)
Me.Child2.SetFocus
DoCmd.SearchForRecord , , acFirst, "[DATAED By Day] = 'strFind'"
Me.Child2.Report![DATAED By Day].SetFocus