Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Queries

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 02-06-2010, 02:51 PM
catbob catbob is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Feb 2010
Posts: 3
catbob is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 02-07-2010, 03:33 PM
llkhoutx llkhoutx is offline Windows Vista Access 2007 (version 12.0)
Expert
 
Join Date: Jan 2010
Location: Houston, Texas USA
Posts: 340
llkhoutx is on a distinguished road
Default

the criteria for a prompt is

Code:
SELECT Table1.Field1
FROM Table1
WHERE Table1
.Field1=[Prompt description message]; 
Reply With Quote
  #3  
Old 02-08-2010, 03:04 PM
catbob catbob is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Feb 2010
Posts: 3
catbob is on a distinguished road
Default 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.
Reply With Quote
  #4  
Old 02-08-2010, 04:30 PM
llkhoutx llkhoutx is offline Windows Vista Access 2007 (version 12.0)
Expert
 
Join Date: Jan 2010
Location: Houston, Texas USA
Posts: 340
llkhoutx is on a distinguished road
Default

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
Reply With Quote
  #5  
Old 02-08-2010, 05:24 PM
catbob catbob is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Feb 2010
Posts: 3
catbob is on a distinguished road
Default

OK. That gives me some ideas of how to proceed.

Thanks!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select value from a list box Hidenite Queries 8 01-29-2010 08:31 AM
Pass list as parameter to in operator bliever Queries 5 11-11-2009 12:15 AM
Can't alays select an item from a list box bomber Access 0 10-16-2009 08:01 AM
Select Item from drop down list rather than enter in an input box???? jhjarvie Programming 8 09-24-2009 12:56 PM
2 multi select list boxes on one search form woodey2002 Forms 1 02-24-2009 05:20 AM


All times are GMT -8. The time now is 02:41 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.