Query database before finalizing report

I have a memo control that takes a customer number to query the database to create a report. Is there a way to query the database and give the user the option to reenter the number if it does not exist? The data is displayed in a MasterData band along with a group heading. Currently when no data is found, the report runs and displays a message if there is no result. Then the user has to run the report again. It would be helpful if the user input section of the report was more interactive.
Any suggestions? Can that be done with FastReports?
Thanks

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 6:50PM
    use dialog form enter and open the query dataset after exiting the memo control and see if there is a record count
    if none set the mrok button to false and show a message.
  • gordkgordk St.Catherines On. Canada.
    edited 6:50PM
    You might also take a look at the main demo underdialog and scripts
    at the choose records to print demo for another idea.
  • edited 6:50PM
    Thanks, gordk. That works perfectly for my report in the OnChange event by keeping the OK button disabled.
    Now I'm trying to verify if the number exists in a date range. A start date and end date are entered in DateEdit controls. Querying the database each time the user scrolls through each calendar might be too much, so I am trying the OnExit event for those controls. The problem with that approach... exiting one control to change the other can cause a message to pop up.

    Is there a way to query the database after the user clicks the mrok button, and then stop the report from running if there are no results from the query? I am guessing there is not.

    Your answer is still helpful, and I'll still come up with a workable solution regardless.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.