Results 1 to 6 of 6
  1. #1
    P.Malius is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    10

    Exclamation Query Criteria Based on Item Selected???


    Hello, my database is used for tracking inventory items, I have a form which uses a subform based on a query which totals up order quantities(when picking items they are group for the ease of the storeman however they are stored in the database by the location they are being delivered to). E.G. 2 pens have to go to location 'A' and 3 pens have to go to location 'B', all the store man will see is 5 pens and he needs to be able to tick off that the items have been gathered for delivery.

    The subform is formatted as a datasheet. As it stands the subform is not updatable. Part of the datasheet is a yes/no box for if the items are issued, my thinking is if I can use a query to pull up the individual location items when the storeman clicks on 'issued' then I can use update queries to say the items have been gathered.

    Long story short, I want to know if a query criteria can be based on a value in the form.

    Any help will be much appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Sure, just put the full form reference in the criteria. In design view you can right click and select Build.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    P.Malius is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    10
    Quote Originally Posted by pbaldy View Post
    Sure, just put the full form reference in the criteria. In design view you can right click and select Build.
    Hi, thanks for your answer.

    I have tried this before but without success. When I try this method I get the message box to enter my query criteria. I presumed it was because I was using a datasheet as the subform so there was no direct link to the value I wanted. I want to use as least operator input as possible so if I can limit it to one click of a button that would be great.

  4. #4
    Parsonshere is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2012
    Location
    Rusk
    Posts
    25
    docmd.RunCommand acCmdSaveRecord If you can add that prior to trying to pull criteria, it may help. Are you running this from the Boolean checkbox event procedure? This is tricky, sometime I have to make it a two step process, it just don't seem to work inside one routine, so I wind up calling a second subroutine from the first. Seems like I always get it to work, but I never really understand what the real fix was, and sometimes my not working routine will work after I reboot. go figure. It only happens when I attempt to do what you are doing here though.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Was the form open when the query ran? It has to be.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    P.Malius is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    10
    Hi, An update, Firstly, of course my form was open as you said, it had to be . Furthermore my problem has been solved. To get around the issue, a text box was place onto the form I was using, this was then reference to the datasheet which pulled up the first item on the list the query was then build to use this text box as a criteria rather than trying to reference a point in the datasheet. Thanks for your replies guys, I appreciate the efforts .

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

Similar Threads

  1. Replies: 6
    Last Post: 05-10-2012, 08:20 PM
  2. Combo box - Open at last item selected
    By mitchy1111 in forum Programming
    Replies: 2
    Last Post: 10-07-2011, 07:23 AM
  3. Replies: 7
    Last Post: 08-31-2011, 05:09 PM
  4. Replies: 4
    Last Post: 07-27-2011, 09:52 AM
  5. Replies: 1
    Last Post: 11-23-2010, 01:30 PM

Tags for this Thread

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