Results 1 to 3 of 3
  1. #1
    Dan Kenton is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    12

    SQL "Where" command for Subform

    I have a subform with a field that contains a drop-down list of product IDs. I wrote a macro and assigned it to a button that, when pressed, opens up the the inventory master form displaying each product's attributes along with a picture of the item. I am trying to use the WHERE command in the macro to sync the chosen product ID in the subform list to the inventory master form when it pops on the screen. Unfortunately, I keep getting a parameter box asking which productID I want. Here's the language used:

    [productID] = [forms]![frm inventorymster]![productid]



    I've had this work on forms without subforms so perhaps this is my problem?

    Thanks for the help!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Here's a link to the various ways to refer to Forms and subforms

    http://www.mvps.org/access/forms/frm0031.htm

  3. #3
    Dan Kenton is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    12
    Thanks Orange but this appears to be all VBA. Can't this be done in SQL within the macro's WHERE field?

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

Similar Threads

  1. Replies: 5
    Last Post: 04-21-2011, 08:16 AM
  2. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM
  3. Replies: 1
    Last Post: 05-13-2010, 10:50 AM
  4. "Next" Command button.
    By vCallNSPF in forum Forms
    Replies: 8
    Last Post: 01-20-2010, 04:26 PM
  5. "There was an error executing this command"
    By rnichols86 in forum Access
    Replies: 16
    Last Post: 11-18-2009, 06:56 PM

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