Form to lookup data & generate report

  • Thread starter Thread starter Amy Becker
  • Start date Start date
A

Amy Becker

Hello, I am having trouble getting only specific data to
show up on my report. I have a database with about 1600
records so I would like to have the option of only
printing a report on a specified record in the database.
I created a query that asks for user input to pull up
only one record, but it requires that the user type in
the full & exact name. I also created an unbound
combobox that generates all of the applicable record
names. I do not know how to link these two objects & use
the form to generate my specific report. I would like
the form to pop up when the user asks to run the report,
and then the user can use the form to find the applicable
name. I hope this makes sense. Any help is appreciated!
THANKS
Amy B.
 
Hello, I am having trouble getting only specific data to
show up on my report. I have a database with about 1600
records so I would like to have the option of only
printing a report on a specified record in the database.
I created a query that asks for user input to pull up
only one record, but it requires that the user type in
the full & exact name. I also created an unbound
combobox that generates all of the applicable record
names. I do not know how to link these two objects & use
the form to generate my specific report. I would like
the form to pop up when the user asks to run the report,
and then the user can use the form to find the applicable
name. I hope this makes sense. Any help is appreciated!
THANKS
Amy B.

Here's how.
The below finds a specific company's records.
Change the fields to whatever you need.

Note... You should be searching for the record by some field other
than the name field. It is not unusual to have more than one person,
company, product, place, etc. to have the same name.
Each record should have it's own unique ID field.
Use that to select the proper record.

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CompanyID field and the Company Name.
Name the Combo Box 'FindCompany'.
Set it's Bound column to 1.
Set it's Column Count to 2
Set the Column Width property to 0";1"
Set it's AutoExpand to Yes.
Set it's Limit to List to Yes.

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source (the query) [CompanyID] field criteria
line write:
forms!ParamForm!FindCompany

Make sure the datatype of this query field matches the datatype of the
bound column of the combo box.

Next, code the Report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the Report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of the Company.
Click the command button and then report will run.
When the report closes, it will close the form.
You will not see the query.
 
Thanks, everything works great except that the report
comes up blank now...it doesn't "pause" to let the user
select a company, it just quickly opens the form, but
then before you know it, the report is up & blank. Any
ideas? Thanks!
Amy
-----Original Message-----
Hello, I am having trouble getting only specific data to
show up on my report. I have a database with about 1600
records so I would like to have the option of only
printing a report on a specified record in the database.
I created a query that asks for user input to pull up
only one record, but it requires that the user type in
the full & exact name. I also created an unbound
combobox that generates all of the applicable record
names. I do not know how to link these two objects & use
the form to generate my specific report. I would like
the form to pop up when the user asks to run the report,
and then the user can use the form to find the applicable
name. I hope this makes sense. Any help is appreciated!
THANKS
Amy B.

Here's how.
The below finds a specific company's records.
Change the fields to whatever you need.

Note... You should be searching for the record by some field other
than the name field. It is not unusual to have more than one person,
company, product, place, etc. to have the same name.
Each record should have it's own unique ID field.
Use that to select the proper record.

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CompanyID field and the Company Name.
Name the Combo Box 'FindCompany'.
Set it's Bound column to 1.
Set it's Column Count to 2
Set the Column Width property to 0";1"
Set it's AutoExpand to Yes.
Set it's Limit to List to Yes.

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source (the query) [CompanyID] field criteria
line write:
forms!ParamForm!FindCompany

Make sure the datatype of this query field matches the datatype of the
bound column of the combo box.

Next, code the Report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the Report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of the Company.
Click the command button and then report will run.
When the report closes, it will close the form.
You will not see the query.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Ok, I got it to stop doing the previous thing, but now it
brings up the form with the combobox, I select the
appropriate data, and then a message box pops up and asks
me to input the data again (without the help of the
combobox). Any ideas? Thanks!
Amy
-----Original Message-----
Thanks, everything works great except that the report
comes up blank now...it doesn't "pause" to let the user
select a company, it just quickly opens the form, but
then before you know it, the report is up & blank. Any
ideas? Thanks!
Amy
-----Original Message-----
data
to

Here's how.
The below finds a specific company's records.
Change the fields to whatever you need.

Note... You should be searching for the record by some field other
than the name field. It is not unusual to have more
than
one person,
company, product, place, etc. to have the same name.
Each record should have it's own unique ID field.
Use that to select the proper record.

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CompanyID field and the Company Name.
Name the Combo Box 'FindCompany'.
Set it's Bound column to 1.
Set it's Column Count to 2
Set the Column Width property to 0";1"
Set it's AutoExpand to Yes.
Set it's Limit to List to Yes.

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source (the query) [CompanyID] field criteria
line write:
forms!ParamForm!FindCompany

Make sure the datatype of this query field matches the datatype of the
bound column of the combo box.

Next, code the Report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the Report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of the Company.
Click the command button and then report will run.
When the report closes, it will close the form.
You will not see the query.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
.
 
Thanks, everything works great except that the report
comes up blank now...it doesn't "pause" to let the user
select a company, it just quickly opens the form, but
then before you know it, the report is up & blank. Any
ideas? Thanks!
Amy
-----Original Message-----
Hello, I am having trouble getting only specific data to
show up on my report. I have a database with about 1600
records so I would like to have the option of only
printing a report on a specified record in the database.
I created a query that asks for user input to pull up
only one record, but it requires that the user type in
the full & exact name. I also created an unbound
combobox that generates all of the applicable record
names. I do not know how to link these two objects & use
the form to generate my specific report. I would like
the form to pop up when the user asks to run the report,
and then the user can use the form to find the applicable
name. I hope this makes sense. Any help is appreciated!
THANKS
Amy B.

Here's how.
The below finds a specific company's records.
Change the fields to whatever you need.

Note... You should be searching for the record by some field other
than the name field. It is not unusual to have more than one person,
company, product, place, etc. to have the same name.
Each record should have it's own unique ID field.
Use that to select the proper record.

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CompanyID field and the Company Name.
Name the Combo Box 'FindCompany'.
Set it's Bound column to 1.
Set it's Column Count to 2
Set the Column Width property to 0";1"
Set it's AutoExpand to Yes.
Set it's Limit to List to Yes.

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source (the query) [CompanyID] field criteria
line write:
forms!ParamForm!FindCompany

Make sure the datatype of this query field matches the datatype of the
bound column of the combo box.

Next, code the Report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the Report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of the Company.
Click the command button and then report will run.
When the report closes, it will close the form.
You will not see the query.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

Did you open the report in Dialog as I wrote it?

DoCmd.OpenForm "ParamForm", , , , , acDialog
 
Back
Top