943,981 Members | Top Members by Rank

Ad:
Mar 23rd, 2007
0

query with combo box input

Expand Post »
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 2:35 am.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
bhuvan83 is offline Offline
29 posts
since Mar 2007
Mar 26th, 2007
0

Re: query with combo box input

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."
Reputation Points: 10
Solved Threads: 3
Junior Poster in Training
carolraydon is offline Offline
57 posts
since Mar 2006
Mar 26th, 2007
0

Re: query with combo box input

thanks bro.
just did the same 2 days ago only.
once again thanks
Reputation Points: 10
Solved Threads: 0
Light Poster
bhuvan83 is offline Offline
29 posts
since Mar 2007
Feb 17th, 2010
0

It is possible

Click to Expand / Collapse  Quote originally posted by bhuvan83 ...
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

When I find it, I'll get back to you with it I read about it not too long ago but kick myself for not saving the link. So my search continues and when I find it... I'll share!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Spins is offline Offline
1 posts
since Feb 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS Access and FileMaker Pro Forum Timeline: How to make a link in a acces form to a website
Next Thread in MS Access and FileMaker Pro Forum Timeline: SQL statement to query user input??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC