OK guys - here's the scoop ---
I have a form showing all records. I have several unbound controls at the bottom accepting any combination of search criteria, for example FIRSTNAME and LASTNAME and STATE, etc. The user fills in any or all of the search fields and then hits a command button.
My command button then either does an ApplyFilter to the form or SetRecordSource to a generated SQL statement. Either way I get the same results, and surprising when there is data which meets criteria, it works great and the filtered records are displayed on the form correctly.
The problem is when there are no records that match the criteria. The form goes blank, almost disabled, and the navigation buttons go away and no records are shown. Any button or move I make after that gives me an error. The exact error does not appear to be really pertinent to this question, because depending on what button you press you will get a different error. What I mean is, the command click events still function but I have variables and focus and enables to reset which I cannot seem to do because I cannot catch the fact that there are no records to display *before* setting the filter on the form.
How the heck do you handle this. It works well now with that exception and I was hoping not to delve into recordsets at this point if I don't have to because I really don't understand them yet.
Any ideas are greatly appreciated.
- Bob
I have a form showing all records. I have several unbound controls at the bottom accepting any combination of search criteria, for example FIRSTNAME and LASTNAME and STATE, etc. The user fills in any or all of the search fields and then hits a command button.
My command button then either does an ApplyFilter to the form or SetRecordSource to a generated SQL statement. Either way I get the same results, and surprising when there is data which meets criteria, it works great and the filtered records are displayed on the form correctly.
The problem is when there are no records that match the criteria. The form goes blank, almost disabled, and the navigation buttons go away and no records are shown. Any button or move I make after that gives me an error. The exact error does not appear to be really pertinent to this question, because depending on what button you press you will get a different error. What I mean is, the command click events still function but I have variables and focus and enables to reset which I cannot seem to do because I cannot catch the fact that there are no records to display *before* setting the filter on the form.
How the heck do you handle this. It works well now with that exception and I was hoping not to delve into recordsets at this point if I don't have to because I really don't understand them yet.
Any ideas are greatly appreciated.
- Bob