can you make a form that allows you to build queries ?

L

levi135

I have 62 queries is there a way to make a form or dialog
box so i can change the 1 and only difference in the
queries

What i mean is ?
the queries are for people the work for different
employers i have a db that contains 2000 people but they
work for 62 employers and i need to know who works for
who, so i created queries for each employer, but it will
take a lot of time and space to put them all on the
switchboard, so the user can access the queries easy.
What i would like to be able to do is let the user just
fill out the employers name ( or collect it from the
company table ) in a dialog box of or for AND RUN THE
QUERY FROM THERE ...
any suggestions.
 
C

Chris Nebinger

Why don't you just use 1 query, then have it prompt for
the employer?

Select * from Employees Where Employer=[Enter Employer]

Otherwise, assuming you have a standard naming convention:


DoCmd.OpenQuery("qry" & Inputbox("Enter Employer"))



Chris Nebinger
 
L

LEVI

This sounds like what I want to do but don't under stand
how to do it.
A Bit more info for you might be able to help explain
better.
I have my DB sorted like this.
3 main tables where the records are called "tbldetails"
(with names address ect+ company this is the field where
the queries are based on, which uses a combo box from a
(sub table) called "company" which has all the company
names in it)
And 2 more tables which are not related to the queries as
I have them set up at the moment.
at the momnet i have 1 querie for every company nameed in
the list from the table "company"
Regards Levi (thanks for the help so far)
-----Original Message-----
Why don't you just use 1 query, then have it prompt for
the employer?

Select * from Employees Where Employer=[Enter Employer]

Otherwise, assuming you have a standard naming convention:


DoCmd.OpenQuery("qry" & Inputbox("Enter Employer"))



Chris Nebinger

-----Original Message-----
I have 62 queries is there a way to make a form or dialog
box so i can change the 1 and only difference in the
queries

What i mean is ?
the queries are for people that work for different
employers i have a db that contains 2000 people but they
work for 62 employers and i need to know who works for
who, so i created queries for each employer, but it will
take a lot of time and space to put them all on the
switchboard, so the user can access the queries easy.
What i would like to be able to do is let the user just
fill out the employers name ( or collect it from the
company table ) in a dialog box of or for AND RUN THE
QUERY FROM THERE ...
any suggestions.

.
.
 
D

Duane Hookom

Consider creating a new, blank form. Add a combo box of your company table
that displays all companies and has a bound column with the value equal to
the company value stored in tblDetails. You can then create your query with
a criteria under the company field of something like:
Forms!frmYourNewFormName!cboCompany

--
Duane Hookom
MS Access MVP


LEVI said:
This sounds like what I want to do but don't under stand
how to do it.
A Bit more info for you might be able to help explain
better.
I have my DB sorted like this.
3 main tables where the records are called "tbldetails"
(with names address ect+ company this is the field where
the queries are based on, which uses a combo box from a
(sub table) called "company" which has all the company
names in it)
And 2 more tables which are not related to the queries as
I have them set up at the moment.
at the momnet i have 1 querie for every company nameed in
the list from the table "company"
Regards Levi (thanks for the help so far)
-----Original Message-----
Why don't you just use 1 query, then have it prompt for
the employer?

Select * from Employees Where Employer=[Enter Employer]

Otherwise, assuming you have a standard naming convention:


DoCmd.OpenQuery("qry" & Inputbox("Enter Employer"))



Chris Nebinger

-----Original Message-----
I have 62 queries is there a way to make a form or dialog
box so i can change the 1 and only difference in the
queries

What i mean is ?
the queries are for people that work for different
employers i have a db that contains 2000 people but they
work for 62 employers and i need to know who works for
who, so i created queries for each employer, but it will
take a lot of time and space to put them all on the
switchboard, so the user can access the queries easy.
What i would like to be able to do is let the user just
fill out the employers name ( or collect it from the
company table ) in a dialog box of or for AND RUN THE
QUERY FROM THERE ...
any suggestions.

.
.
 
G

Guest

thanks fro that works a treat.
is there a way to print the results ??
-----Original Message-----
Consider creating a new, blank form. Add a combo box of your company table
that displays all companies and has a bound column with the value equal to
the company value stored in tblDetails. You can then create your query with
a criteria under the company field of something like:
Forms!frmYourNewFormName!cboCompany

--
Duane Hookom
MS Access MVP


This sounds like what I want to do but don't under stand
how to do it.
A Bit more info for you might be able to help explain
better.
I have my DB sorted like this.
3 main tables where the records are called "tbldetails"
(with names address ect+ company this is the field where
the queries are based on, which uses a combo box from a
(sub table) called "company" which has all the company
names in it)
And 2 more tables which are not related to the queries as
I have them set up at the moment.
at the momnet i have 1 querie for every company nameed in
the list from the table "company"
Regards Levi (thanks for the help so far)
-----Original Message-----
Why don't you just use 1 query, then have it prompt for
the employer?

Select * from Employees Where Employer=[Enter Employer]

Otherwise, assuming you have a standard naming convention:


DoCmd.OpenQuery("qry" & Inputbox("Enter Employer"))



Chris Nebinger


-----Original Message-----
I have 62 queries is there a way to make a form or dialog
box so i can change the 1 and only difference in the
queries

What i mean is ?
the queries are for people that work for different
employers i have a db that contains 2000 people but they
work for 62 employers and i need to know who works for
who, so i created queries for each employer, but it will
take a lot of time and space to put them all on the
switchboard, so the user can access the queries easy.
What i would like to be able to do is let the user just
fill out the employers name ( or collect it from the
company table ) in a dialog box of or for AND RUN THE
QUERY FROM THERE ...
any suggestions.

.

.


.
 
D

Duane Hookom

You create a report based on the query and then add a button to the form
that opens the report.

--
Duane Hookom
MS Access MVP
--

thanks fro that works a treat.
is there a way to print the results ??
-----Original Message-----
Consider creating a new, blank form. Add a combo box of your company table
that displays all companies and has a bound column with the value equal to
the company value stored in tblDetails. You can then create your query with
a criteria under the company field of something like:
Forms!frmYourNewFormName!cboCompany

--
Duane Hookom
MS Access MVP


This sounds like what I want to do but don't under stand
how to do it.
A Bit more info for you might be able to help explain
better.
I have my DB sorted like this.
3 main tables where the records are called "tbldetails"
(with names address ect+ company this is the field where
the queries are based on, which uses a combo box from a
(sub table) called "company" which has all the company
names in it)
And 2 more tables which are not related to the queries as
I have them set up at the moment.
at the momnet i have 1 querie for every company nameed in
the list from the table "company"
Regards Levi (thanks for the help so far)

-----Original Message-----
Why don't you just use 1 query, then have it prompt for
the employer?

Select * from Employees Where Employer=[Enter Employer]

Otherwise, assuming you have a standard naming convention:


DoCmd.OpenQuery("qry" & Inputbox("Enter Employer"))



Chris Nebinger


-----Original Message-----
I have 62 queries is there a way to make a form or
dialog
box so i can change the 1 and only difference in the
queries

What i mean is ?
the queries are for people that work for different
employers i have a db that contains 2000 people but they
work for 62 employers and i need to know who works for
who, so i created queries for each employer, but it will
take a lot of time and space to put them all on the
switchboard, so the user can access the queries easy.
What i would like to be able to do is let the user just
fill out the employers name ( or collect it from the
company table ) in a dialog box of or for AND RUN THE
QUERY FROM THERE ...
any suggestions.

.

.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top