So i have a list box that's row source is bound to a query (qryCompanyAndAssoc) that filters company information. There's two columns in this list box that display dates. Right now I'm trying to implement a date range filter, where the user selects a from and to date via two text boxes and the listbox would display the results. This is what I have so far:
Private Sub Command81_Click()
Dim srchCriteria, task As String
[login to view URL]
If IsNull([login to view URL]) Or IsNull([login to view URL]) Then
MsgBox "Please enter the date range", vbInformation, "Date Range Required"
[login to view URL]
srchCriteria = "([AAEndDate] >= #" & [login to view URL] & "# And [AAEndDate] <= #" & [login to view URL] & "#)"
task = " SELECT * FROM qryCompanyANDAssoc WHERE (" & srchCriteria & ") order by [AAEndDate]"
[login to view URL] task
AAEndDate = Association Agreement End Date
txtFrom = Date From
txtTo = Date To
The text boxes are set to Short Date format and when I select a date range then click search I'm given an error saying "Error: 2491 The action or method is invalid because the form or report isn't bound to a table or query" and [login to view URL] task is highlighted yellow.
If anyone has some suggestions or advice on how to solve this, a rookie like me, I would really appreciate it!
18 freelancer menawar dengan rata-rata $29 untuk pekerjaan ini
Hi, This is a fairly simple task. It doesn't need that much code. Let me get remote access to your computer and I will show you how to get it set up. Kindly, Alaeddin
Hello sir I am MS Access expert. I have read your project description and very much interested in your task. I can help you with the task if you give me a chance. So Please contact me. Thanks.
Hi there, I recreated the problem in my access database and found the problem. I have a new suggested method to do this work. Please hire me, you will not be dissapointed. I'm located in the US. Regards, Milton