473,769 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parameter in query to dropdown list

Hi, i'm making an application in Access and in the query made, i'd
like the user to fill in a parameter when opening the query (in a
report). It's much easier for the user if the parameter was a dropdown
list from which he can select, because the parameters are rather
long...

Does anyone know how to make that dropdown list?

TIA
Nov 13 '05 #1
4 3521
As far as I know, the best way to do this would be to create a table
containing the values you want in you list. Create a pop-up form with a
combo box where the source is the newly created table. Then set the criteria
of your query to Forms!Your_PopU pForm!Your_Comb o.

Instead of having a command button to open the report, use the command
button to open the pop-up form. Have another command button on this form
which opens up the report. It may be an idea to add a line of code on the
"open report" command to open the pop-up form as invisible so that it
disappears when the report is run!!!

Some of the guru's may come up with a better solution but that would work!

Mark

"Theo Jansen" <th********@gma il.com> wrote in message
news:6b******** *************** ***@posting.goo gle.com...
Hi, i'm making an application in Access and in the query made, i'd
like the user to fill in a parameter when opening the query (in a
report). It's much easier for the user if the parameter was a dropdown
list from which he can select, because the parameters are rather
long...

Does anyone know how to make that dropdown list?

TIA

Nov 13 '05 #2

"Theo Jansen" <th********@gma il.com> wrote in message
news:6b******** *************** ***@posting.goo gle.com...
Hi, i'm making an application in Access and in the query made, i'd
like the user to fill in a parameter when opening the query (in a
report). It's much easier for the user if the parameter was a dropdown
list from which he can select, because the parameters are rather
long...

Does anyone know how to make that dropdown list?

TIA


This will involve a bit of work and some VBA coding. Basically, you create
a small form with a combobox on it which gets the values from the table.
You also have 2 buttons OK and Cancel. You create a function called
GetMyParameter( ) as String which opens the form as a dialog and the user
selects the value. Presing OK hides the form, returns the value and the
form can be closed. You can then open the query with that parameter.

Does that point you in the right direction?
Nov 13 '05 #3
I'm trying almost the same thing here, but I still cannot get it to work.
I'm trying to pass a parameter that a user selects from a combo box to a
query. My form is named 'Build' and the combo box is named 'cmbName'. I
type this into the criteria field and Access puts brackets around
everything, 'Forms!Build!cm bName.Value' becomes
'[Forms]![Build]![cmbName].[Value]' (all without the single quote of
course). I've tried every combination of bracks/no brackets that I can
think of, none work. Can someone please tell me the exact syntax for this.

thanks
mike

"Mark" <ma**********@n tlworld.com> wrote in message
news:j9******** ******@newsfe1-win.ntli.net...
As far as I know, the best way to do this would be to create a table
containing the values you want in you list. Create a pop-up form with a
combo box where the source is the newly created table. Then set the criteria of your query to Forms!Your_PopU pForm!Your_Comb o. ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^
Instead of having a command button to open the report, use the command
button to open the pop-up form. Have another command button on this form
which opens up the report. It may be an idea to add a line of code on the
"open report" command to open the pop-up form as invisible so that it
disappears when the report is run!!!

Some of the guru's may come up with a better solution but that would work!

Mark

"Theo Jansen" <th********@gma il.com> wrote in message
news:6b******** *************** ***@posting.goo gle.com...
Hi, i'm making an application in Access and in the query made, i'd
like the user to fill in a parameter when opening the query (in a
report). It's much easier for the user if the parameter was a dropdown
list from which he can select, because the parameters are rather
long...

Does anyone know how to make that dropdown list?

TIA


Nov 13 '05 #4
Hi,

I tried this and it works OK:

SELECT MyTable.First FROM MyTable
WHERE MyTable.First=[Forms]![Form2]![cboFirst];

The 'Value' component in your statement is not needed.

HTH -Linda
"Janine and Mike" <j9*******@eart hlink.net> wrote in message
news:Cr******** *******@newsrea d3.news.pas.ear thlink.net...
I'm trying almost the same thing here, but I still cannot get it to work.
I'm trying to pass a parameter that a user selects from a combo box to a
query. My form is named 'Build' and the combo box is named 'cmbName'. I
type this into the criteria field and Access puts brackets around
everything, 'Forms!Build!cm bName.Value' becomes
'[Forms]![Build]![cmbName].[Value]' (all without the single quote of
course). I've tried every combination of bracks/no brackets that I can
think of, none work. Can someone please tell me the exact syntax for this.
thanks
mike

"Mark" <ma**********@n tlworld.com> wrote in message
news:j9******** ******@newsfe1-win.ntli.net...
As far as I know, the best way to do this would be to create a table
containing the values you want in you list. Create a pop-up form with a
combo box where the source is the newly created table. Then set the

criteria
of your query to Forms!Your_PopU pForm!Your_Comb o.

^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^

Instead of having a command button to open the report, use the command
button to open the pop-up form. Have another command button on this form
which opens up the report. It may be an idea to add a line of code on the "open report" command to open the pop-up form as invisible so that it
disappears when the report is run!!!

Some of the guru's may come up with a better solution but that would work!
Mark

"Theo Jansen" <th********@gma il.com> wrote in message
news:6b******** *************** ***@posting.goo gle.com...
Hi, i'm making an application in Access and in the query made, i'd
like the user to fill in a parameter when opening the query (in a
report). It's much easier for the user if the parameter was a dropdown
list from which he can select, because the parameters are rather
long...

Does anyone know how to make that dropdown list?

TIA



Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
2636
by: guitarromantic | last post by:
Hey everyone. I'm re-writing a php Content Management System (based loosely on phpNuke but specific to my site). My first major change was attempting to normalise the Review section database structure. I've created a Staff table with staff email addresses and names (plus id), and a Reviews table with the text of the reviews. The Reviews table contains an 'author' field with a value that corresponds to the Staff table. When I display a...
1
2018
by: Greg | last post by:
I am tying to set a parameter in a query that will only slect cutomer codes between two given #'s. I have a 3 part query....... 1st I am querying the customer codes that have a current balance. Then I am using a crosstab pulling from that query to get the current, over 30, over 60, etc.... and then I am putting that in another query to get the company names and addresses for my report. I am unable to specify the cutomer codes by a...
6
2779
by: sheree | last post by:
I would like to create a query where one of the columns of the queries comes from a combo list box on a form. For example, if my table has the following fields: id name interest1 interest2 interest3 my combo box would be a dropdown containing these choices:
2
5697
by: msnews.microsoft.com | last post by:
How do I get Intellisense to open a dropdown list box for a method's parameters when the parameter is an ENUM? public class MyClass { public enum IDkind { PersonID, EntityID, PlaceID
0
4805
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having manually inserted a row in the table bound to the Combo box. The InsertAt Method of adding a row just does not work. Hope this helps anyone with this problem. john
2
2410
by: SF | last post by:
Hi, I am new to ASP.NET. I started my first testing ASP.NET by having a ASP page consist of a drop-down control and 1 datagrid bound to Access database. The dropdown control works very well except the datgrid becuase I want to limit the datgrid to display only information selected in the dropdown control. For this purpose I have create a dataset having a query that would serve as source to datagrid. I am unable to specify the parameter...
1
5078
by: waltnixon | last post by:
I've got an MS Access query which runs fine when double clicked and returns all of the rows in a test database I'm building. I've set up a multi group report based on the query. I immediately began getting the "Enter Parameter Value" dialog and it was asking for the query by its name "sel_report_data" whenever I tried to run or preview the report. To troubleshoot the problem, I selected the query in the database window, hit the "New...
16
3519
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for renaming the duplicate records? My thinking was to take the results of the duplicate query, and somehow have it number each line where there is a duplicate (tried a groups query, but "count" won't work), then do an update query to change the duplicate to...
0
1284
kcdoell
by: kcdoell | last post by:
Hello: I have a form that I am using to help me display a query that I have built. On that form I have multiple combo boxes that I have called cobMonth, cobYear, cobWorkingRegion, etc... (basically these are certain field names in my query). I also have a command button called “Run query”. Currently, I have designed it so that if I select any of the options in my dropdown list I am able to narrow down my query result. I accomplished this by...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.