User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 402,904 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,123 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser: Programming Forums
Views: 10318 | Replies: 2 | Solved
Reply
Join Date: Mar 2007
Location: India
Posts: 28
Reputation: bhuvan83 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
bhuvan83's Avatar
bhuvan83 bhuvan83 is offline Offline
Light Poster

query with combo box input

  #1  
Mar 23rd, 2007
hi every1
i m creating a simple ms access project.
i created a report ,when the user opens it,it opens a query which askes user to enter name.
the user enters the name and the report by that name generates.
is there a possibility that when the name is asked instead of a text box a combo box appears and it has pre entered names,from which user can choose and doesn't have to enter.
plz help as i hv to submit this project today.


and is there any option through which i can put a password on my access project
thanks in advance
Last edited by bhuvan83 : Mar 23rd, 2007 at 1:35 am.
Bhuvan Aggarwal
There is no word impossible.
its i m possible
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2006
Location: Moorea, French Polynesia
Posts: 56
Reputation: carolraydon is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 3
carolraydon carolraydon is offline Offline
Junior Poster in Training

Re: query with combo box input

  #2  
Mar 26th, 2007
Hi Bhuvan,
Here is a little jump-start for your parameter combo-box. It is from the book, Fixing Access Annoyances. You'd better work fast though, if your assignment is already 2 days late. Have fun.

"...use form data as parameters for queries.
First, create an unbound form and add the controls that you'll need for user input. Use text boxes for free-form data entry, combo and list boxes to constrain users to predefined values, and any other controls you need. All the usual "good design" practices apply, so use format and validation rules where appropriate to help your users submit valid parameters. Don't forget to add a "Run query" button.
Once the form is complete, you can reference its data in your query by placing fully qualified control names such as Forms!frmMyParamForm!txtMyParamField on the Criteria line of your query. ("Fully qualified" simply means using the whole path, not just the short name; in this example, txtMy-ParamField is the short name.) Here, frmMyParamForm is the name of your unbound form, and txtMyParamField is the name of a field on that form. For example, to use a date range as a query criterion, you'd enter something like Between Forms!frmMyParamForm!txtStartDate And Forms!frmMyParamForm!txtEndDate on the Criteria line of your query. When the user hits the "Run query" button, the query will pull those values (namely, the start and end dates she's entered in the form) from the data entry form. If your data entry form uses a combo box rather than a text box, you can use its value, like this: Forms!frmMyParamForm!cboMyComboBox. The usual rules about declaring parameter data types apply here.
In order for this to work, the form must be open, with the date range already entered, when the query is run. (If it isn't, Access won't be able to resolve the control names and will resort to the "Enter Parameter Value" prompt. You don't want that.) The simplest way to ensure this is to put the "Run query" button on the form itself. You can use the Command Button Wizard to do this. Once the wizard starts, choose the Run Query action in the Miscellaneous category on its first page."
Reply With Quote  
Join Date: Mar 2007
Location: India
Posts: 28
Reputation: bhuvan83 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
bhuvan83's Avatar
bhuvan83 bhuvan83 is offline Offline
Light Poster

Re: query with combo box input

  #3  
Mar 26th, 2007
thanks bro.
just did the same 2 days ago only.
once again thanks
Bhuvan Aggarwal
There is no word impossible.
its i m possible
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS Access and FileMaker Pro Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS Access and FileMaker Pro Forum

All times are GMT -4. The time now is 3:20 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC