Query help please

Jenny1

Registered User.
Local time
Today, 14:33
Joined
May 3, 2007
Messages
61
Hi All my queries are working apart from the last one - I think I have forgotten how to do do it,can someone please help.

On my main menu form I have a query labelled 'Search By Role.

I want to have a query input box to appear when I click 'Run'

But instead of opening a input box, it opens the query result in datasheet view. And shows all results.

Please help me fix this.

Database attached
 

Attachments

I want the query searchbox to be limitied to seaches on the following:

I would really appreciate your help

Placement (u/g only)
Internship (p/g only)
Project work only (i.e. not linked to placement or internship)
IT role
HR role
Senior management role
 
You need to create another form with a combobox on it, that allows the user to select one of the specified roles.

Change the OnClick of your menu Search By Rule button to open up the new form and add a button to your new form that runs the query.

In your query you need to add the following as Criteria unnder Role

[Forms]![nameofformyoucreated]![nameofcomboboxyoucreated]
 
But if you look at my forms section there are no additional forms for the other search boxes, how comes I have to have a form for this.
 
Because on the others you are asking for a value and not limiting what the user can enter as criteria, whilst in this query you are limiting the criteria a user can enter by providing a list of what they can search on, unless I'm reading what you asked for wrong.

If you just want a prompt for a user to enter a value, put this in the criteria under Role in your query

[Please Enter the Role You Require] or whatever wording you want.
 
You need to create another form with a combobox on it, that allows the user to select one of the specified roles.

Change the OnClick of your menu Search By Rule button to open up the new form and add a button to your new form that runs the query.

In your query you need to add the following as Criteria unnder Role

[Forms]![nameofformyoucreated]![nameofcomboboxyoucreated]

Thanks MJ I have done all of what you said apart from this last bit (above)

Can you give me more guidance on this? how do I do it? where do I put the
[Forms]![nameofformyoucreated]![nameofcomboboxyoucreated] information

I have attached the file - would it be possible for you to check if I have followed the instructions correctly.

Thanks in advance
 

Attachments

Hi,

Ok I've had a look, looks ok, you just need to finish it off by:

1. Adding an On Click Event to your Display button to open the query SearchRole

2. Put this as your criteria in the SearchRole Query under the Role column
[Forms]![SearchRole]![Combo0]

That should sort it for you.
 
Thanks, I have changed to onclick event to open the search role macro (which opens the query).

But I still dont understand where you want me to put point 2.??
 
Okay,

MJR I have taken all your advice and the result is attached.

Problem is when I click display nothing happens.

What do you think?
 

Attachments

The onclick you have is set to opensearchrole, if you look at that macro it is set to open the searchrole form, you need to change it to Open Query SearchRole.
 
I changed it but now its doing something wierd
 

Attachments

Ok, you need to create a new macro, call it opensearchroleform and put that in the on click event of the Search By Role Run command button on the menu.

The opensearchroleform macro should open the SearchRole form.
 
Sorry to keep bothering you Mike, but when I click display, nothing happens
 

Attachments

Ok,

I've fixed it for you, I reinstated the opensearchrole macro behind the Display button (sorry I should have said that in last post)
See attached db .
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom