Good morning everyone,
I need some help from this forum.
I have a search form is built from a qry and the qry bases on a table. For some reason, the qry doesnot get all data but the table.
Can anyone point out my error. Many thanks.
My SQL is below:
I need some help from this forum.
I have a search form is built from a qry and the qry bases on a table. For some reason, the qry doesnot get all data but the table.
Can anyone point out my error. Many thanks.
My SQL is below:
Code:
SELECT *
FROM tblAllSongs
WHERE (((tblAllSongs.SongNumber) Like "*" & IIf([Forms]![frmSongSearchOptions]![SongNumber]<>"",[Forms]![frmSongSearchOptions]![SongNumber],"*" & "*") & "*") AND ((tblAllSongs.RptYear) Like IIf([Forms]![frmSongSearchOptions]![Year]<>"",[Forms]![frmSongSearchOptions]![Year],"*")) AND ((tblAllSongs.Author) Like "*" & IIf([Forms]![frmSongSearchOptions]![Author]<>"",[Forms]![frmSongSearchOptions]![Author],"*" & "*") & "*") AND ((tblAllSongs.RptMonth) Like IIf([Forms]![frmSongSearchOptions]![Month]<>"",[Forms]![frmSongSearchOptions]![Month],"*")) AND ((tblAllSongs.TypeOfSong) Like IIf([Forms]![frmSongSearchOptions]![TypeOfSong]<>"",[Forms]![frmSongSearchOptions]![TypeOfSong],"*")) AND ((tblAllSongs.SongArea) Like IIf([Forms]![frmSongSearchOptions]![SongArea]<>" ",[Forms]![frmSongSearchOptions]![SongArea],"*")) AND ((tblAllSongs.Title) Like "*" & IIf([Forms]![frmSongSearchOptions]![Title]<>"",[Forms]![frmSongSearchOptions]![Title],"*" & "*") & "*") AND ((tblAllSongs.Keywords) Like "*" & IIf([Forms]![frmSongSearchOptions]![Keywords]<>"",[Forms]![frmSongSearchOptions]![Keywords],"*" & "*") & "*"))
ORDER BY tblAllSongs.SongNumber;