TeresePamela
Programmer
I have a form where the user inputs the data they want to search for and clicks a "search" button which runs an SQL statement. The results of the SQL is the rowsource for a listbox. All is ruuning fine except I want to display a msgbox stating "No Records Found" if none were found. I cannot figure out how/where to do this. Basically I don't think I understand where SQL is holding the results of the query and how it's passing it to the form, so I don't know what code to put where :-( A sample of the coding:
strSQL="SELECT gidata.recordid, gidata.filnr, gidata.descript" & "FROM gidata"
strwhere = "WHERE"
If Not IsNull(Me.txtfileNr) Then
strwhere = strwhere & "(gidata.dfilnr) like '*" & me.txtfilnr & "*'"
strOrder = "ORDER BY gidata.filnr;'
End If
Me.lstGenDetails.rowsource = strSQL & " " & strWhere & "" & strOrder
Can anyone enlighten me?
As always, all input is appreciated.
Pam
strSQL="SELECT gidata.recordid, gidata.filnr, gidata.descript" & "FROM gidata"
strwhere = "WHERE"
If Not IsNull(Me.txtfileNr) Then
strwhere = strwhere & "(gidata.dfilnr) like '*" & me.txtfilnr & "*'"
strOrder = "ORDER BY gidata.filnr;'
End If
Me.lstGenDetails.rowsource = strSQL & " " & strWhere & "" & strOrder
Can anyone enlighten me?
As always, all input is appreciated.
Pam