i have sucessfully coded my form so that when a user enters data into the texxt box and searches any matching data is displayed on another form my problem is when no data matches the search criteria the form that would display the result still opens but is blank how do i create a message that tells the user there is no matching crieria and stop the other form from opening?
student21
0
Newbie Poster
Recommended Answers
Jump to PostIf you use a DataReader then the answer is quite easy.
The reader has a property called HasRows that indicates whether or not the database query was successful, or not.
Put the code for opening the form inside anIf DataReader1.HasRows = True Then
statement, and the code for displaying …
Jump to PostCheck whether record count is 0 or more than. If its >0 then show ur searh data into second form, else redirect into first form (Search form) with message box
All 6 Replies
Oxiegen
88
Basically an Occasional Poster
Featured Poster
student21
0
Newbie Poster
Renukavani
0
Junior Poster
student21
0
Newbie Poster
Oxiegen
88
Basically an Occasional Poster
Featured Poster
student21
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.