Results 1 to 5 of 5
  1. #1
    catbob is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    3

    Parameter Query: Select From A List?

    Is there a way to create a parameter query where the user can select from a list, instead of typing in a value, when the "Enter Parameter Value" dialog box appears?

    Thanx in advance.

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    the criteria for a prompt is

    Code:
    SELECT Table1.Field1
    FROM Table1
    WHERE Table1
    .Field1=[Prompt description message]; 

  3. #3
    catbob is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    3

    List box for parameter query

    Hello llkhoutx,

    Thank you for responding to my question. Unfortunately, I did not understand your answer where you say "PHP code:" and then list SQL statements. Let me clarify: I am not writing in PHP, but rather creating a simple Access databse, where I am trying to create a parameter query such that the user can select the parameter value from a list, rather than having to type it in.

    Currently, the SQL behind my query looks like this:

    SELECT ...
    FROM ... INNER JOIN ...
    WHERE (((tblServices.Service)=[Please enter Service]));

    When this query is run, a dialog box appears requesting the user to type in a value for the field called "Service". I would like that dialog box to contain a list box or combo box, so that the user can select from a list of currently available services.

    I can accomplish this by writing a VBA module to create my own dialog box or form containing a list box control, but I was wondering if there were a simpler way to do it using a standard Access parameter query.

    Thank you again for responding to my question.

  4. #4
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    Code:
    "PHP code:" 
    is added automatically which inserting something on this form in a window pane. I have no control over that being added to my post.

    A list box row cannot be referenced directly. One would have to store the list box selection in an unbound textbox and then that textbox can be referenced.

    A combox box name can be referenced.

    Problems arise with multi-column combo boxes and multi-column list boxes. I'll not address these issues, as they are apparently at issue.

    Code:
    SELECT ...
    FROM ... INNER JOIN ...
    WHERE tblServices.Service)=Forms!FormName!ControlName

  5. #5
    catbob is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    3
    OK. That gives me some ideas of how to proceed.

    Thanks!

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

Similar Threads

  1. 2 multi select list boxes on one search form
    By woodey2002 in forum Forms
    Replies: 2
    Last Post: 11-05-2010, 12:44 PM
  2. Select value from a list box
    By Hidenite in forum Queries
    Replies: 8
    Last Post: 01-29-2010, 11:31 AM
  3. Pass list as parameter to in operator
    By bliever in forum Queries
    Replies: 5
    Last Post: 11-11-2009, 03:15 AM
  4. Can't alays select an item from a list box
    By bomber in forum Access
    Replies: 0
    Last Post: 10-16-2009, 10:01 AM
  5. Replies: 8
    Last Post: 09-24-2009, 02: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