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

Recommended Answers

All 3 Replies

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."

thanks bro.
just did the same 2 days ago only.
once again thanks
:)

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.