Results 1 to 4 of 4
  1. #1
    dmon2010 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2013
    Posts
    39

    Does a query have to run as soon as checkbox on form is checked?

    I’m using an access 2010 to manage items received. I run a query based on an “Order Number” which returns one or more records. The results appear on a form. This form has info for each record and also has a “Receive” checkbox (yes/no field) that I check when I receive an item. After I check the “Receive” box for the appropriate record, I click a button on the same form to create a receiving report.



    Everything works fine. However, in order to avoid a mistake by receiving an item twice, I’d like to change the query criteria from only searching for records matching the “Order Number” to searching for records that match “Order Number” and where the “Receive” is no, or false. This way something that has already been received will not appear in the query results.

    I can get the query to work fine like this, but my problem is that once I check the “receive” box to create the receiving report, the query picks up the change in the record and removes it from the list of results since the “Receive” has changed to yes, or true.

    Is there a way to make the query run after I print the report instead of right after I check the "Receive" box? Any help would be greatly appreciated. Thanks for your time.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Is there code in one of the properties of the “Receive” checkbox? Something Me.Requery?

  3. #3
    dmon2010 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2013
    Posts
    39
    Quote Originally Posted by ssanfu View Post
    Is there code in one of the properties of the “Receive” checkbox? Something Me.Requery?
    That was it! In the On Click property there was an embedded macro that was set to requery. Can't believe I didn't see it before. Thanks so much for your help!!!

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Happy to help.....

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

Similar Threads

  1. Checkbox data in query: only when checked
    By AsjenW in forum Queries
    Replies: 1
    Last Post: 04-19-2013, 07:43 AM
  2. If checkbox is checked allow query to run
    By burrina in forum Forms
    Replies: 14
    Last Post: 01-29-2013, 03:56 PM
  3. Replies: 2
    Last Post: 10-09-2012, 10:07 AM
  4. VBA for testing if checkbox is checked
    By rhewitt in forum Programming
    Replies: 0
    Last Post: 09-26-2012, 07:11 AM
  5. If checkbox is checked, add X to a current value
    By INeedAboutTreeFiddy in forum Programming
    Replies: 4
    Last Post: 05-30-2012, 08:17 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