Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

How to Pop Up a message to user

Newb question:  How do I pop up a message to the user if the QUERY got no results to show in my DBGRID?
0
VirtueTech
Asked:
VirtueTech
  • 4
  • 2
1 Solution
 
BlackTigerXCommented:
ADOQuery.Open
if (ADOQuery.IsEmpty) then
  ShowMessage('no records returned')

works the same for TQuery
0
 
VirtueTechAuthor Commented:
Thanks.

How can I change the popup window title/caption?
0
 
VirtueTechAuthor Commented:
Nevermind I found it. Thanks.
0
Meet the Family that is Made for Collaboration

The TeamConnect Family product group as part of the Sennheiser for Business Portfolio comprising high-quality, technically well-conceived meeting solutions for business communication – designed for any meeting room and any meeting situation.

 
BlackTigerXCommented:
mmm... the quick and dirty way:

procedure ShowMessageWithTitle(const Msg, Title:string); //use this procedure, provide message and title
var
  s:string;
begin
  s:=Application.Title; //save the original title
  Application.Title:=Title; //put the title you want in your message box
  ShowMessage(Msg);
  Application.Title:=s //restore original title
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessageWithTitle('a big long message', 'with title')
end;
0
 
BlackTigerXCommented:
or the right way... lol
MessageBox(Handle, 'The message here', 'The title here', 0)
0
 
BlackTigerXCommented:
guess the other wasn't so quick... =o(
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now