that sounds great thanks alan .... will fix it now .... will probably use the form idea.
brings me to my next question:
I need 2 msg boxes to show up during searching.
first - a msg box when there are no matches to any of the searched criteria.
second - a msg box when nothing at all has been entered into ALL of the boxes in the search form (it cannot be allowed to fire the code if even one of the boxes has something entered into it)
Code I found was:
]Private Sub Command7_Click()
If Nz(Me.Title, "") > "" Then
If DCount("*", "search", "[Movie Title] = '" & Me.Title & "'") Then
MsgBox ("No movies matching your search. Please refine your search and try again.")
Else
DoCmd.OpenQuery ("search")
]Else
MsgBox "You Must Enter a Title in Order to Search!"
Title.SetFocus
End If
End If
The problem is that this code does two things - one ... it forces the second msg box to show whenever there is nothing in the title search box - even if both other boxes are filled.
two - when no search results are found it still opens a blank datasheet.
There are 3 search criteria and the no results found needs to run on all 3 or any combination of them.
and the second msg box needs to run only if all 3 boxes are empty.
and when the no results found code runs then NO datasheet is to be opened at all - just an immediate return to the main search menu form
Bookmarks