Results 1 to 5 of 5
  1. #1
    PeterS is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    45

    Access 2007 Form & Query Parameters

    In Access 365 the parameter used in a query that is opened by a form with a combo box looks like this;



    [Forms]![frmNAME]![cboNAME]

    When completing the criteria in the query, you are prompted on what to populate......all in all very easy

    If I use the same approach in Access 2007 there is no prompting and the parameter looks like it does nothing except prevent the form form working at all.

    ie: if the combo box offers a selection criteria such as Customer_Name and the Command Button has a Run Report event on click then the report opens unpopulated. If I remove the combo box and the paramater criteria in the query then the report opens perfectly, only not filtered by Cusomer_Name.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    It works if the combo has a value.
    it will not if the combo is empty.

  3. #3
    PeterS is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    45
    If I select the Customer_Name from the combo Box then click on the command button the report opens blank. What do you mean the combo box needs a value?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Can you post a copy of the database in zip format with only enough data to highlight the issue?

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    You shouldn't be prompted again for the criteria if the query takes the value from the form. Are you placing the form reference in the right field of the query? Most combo boxes have two columns, one holding the unique id (CustomerID) and being hidden, and the other holding the descriptor (CustomerName). Even if the combo shows you the name you have to place [Forms]![frmNAME]![cboNAME] in the CustomerID field if that is the bound column.

    Cheers,
    Vlad

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

Similar Threads

  1. Replies: 11
    Last Post: 11-13-2015, 05:11 PM
  2. Replies: 16
    Last Post: 05-04-2014, 09:19 AM
  3. Pass Parameters to Access Query from VB.net
    By kbsudhir in forum Access
    Replies: 1
    Last Post: 11-20-2013, 03:07 PM
  4. Replies: 1
    Last Post: 02-04-2013, 05:52 PM
  5. Replies: 3
    Last Post: 11-17-2010, 05:21 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