Results 1 to 2 of 2
  1. #1
    Tvanduzee is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    39

    Test query results before displaying on the form

    Hello
    I have a form that will display Work Order Numbers in a cbo. These work orders are Provided via query to the form cbo. It only displays WOs where the client name is blank (Which means it is an unused Work Order). How can I test the results of the query before it displays a blank cbo (Meaning that there are currently no new Work Orders Generated). I want to have a msgbox come up and instruct the user to generate new Work Orders before trying to create a new one on the form. (Which means the user opens another form to generate and print work orders). Once the Work Order numbers are generated, they will be available in the forms cbo.

    Ex: If the user clicks the "New Work Order" Button, it makes visible the cbo to offer available work order numbers. But if they have not generated them in advance, it will show up blank. I don't want them to see a blank cbo. So, when they click the "New Work Order" button, I need it to test the results of the query before displaying the results to the cbo. If the recordset is blank, then they will be prompted to generate new work order numbers first. If there are available work orders, then the results simply get displayed to the cbo.

    The on click for the add new work orders is using vba with the docmd to start a new record.

    Hope this is clear enough to understand.

    Thank You


    Terry

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If DCount("*", "QueryName") > 0 Then
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Displaying query results in form
    By celito in forum Access
    Replies: 2
    Last Post: 08-27-2011, 09:14 AM
  2. Replies: 3
    Last Post: 02-04-2011, 07:32 AM
  3. Replies: 9
    Last Post: 12-13-2010, 09:25 PM
  4. Displaying query results within a form
    By Remster in forum Forms
    Replies: 5
    Last Post: 10-05-2010, 09:56 PM
  5. Replies: 0
    Last Post: 03-31-2010, 07:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums