Creating a Search Form!!!

K

Kwgame

I want to create a search form where the user can input a certain report name
and the report is pulled up. In the form, I have a combo box that has a list
of two record types (PTP, TSP) and then in the second box the user inputs the
4 digit number of the record type (ex. PTP 5252) and after that they hit the
search button to pull up the report. All of the reports are named with the
record type first and then the number after (ex. TSP 5152) like the last
example. Can I get some code for this type of search form or at least some
help. (I would love the code!!)
 
J

jahoobob via AccessMonster.com

Simplify by giving the name of each report in one combo. MySysObjects is a
system table that is in each database, usually hidden. As the name indicates,
it lists all of the objects in the db including reports (Type -32764). You
can use a query to show just the report names that begin with PTP and TSP:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Like "PTP *" Or (MSysObjects.Name) Like "TSP *")
AND ((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;

You can then place Code or a Macro behind the AfterUpdate of the form on
which the combo resides that opens the report. If the Form is ReportsList
and the combo is rprts then:

DoCmd.OpenReport Forms!ReportList.rprts, acViewNormal, "", "", acNormal
 
J

jahoobob via AccessMonster.com

Oh BTW, whenever a new report is added to the db that meets the criteria of
the query it shows up in the combo.
Simplify by giving the name of each report in one combo. MySysObjects is a
system table that is in each database, usually hidden. As the name indicates,
it lists all of the objects in the db including reports (Type -32764). You
can use a query to show just the report names that begin with PTP and TSP:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Like "PTP *" Or (MSysObjects.Name) Like "TSP *")
AND ((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;

You can then place Code or a Macro behind the AfterUpdate of the form on
which the combo resides that opens the report. If the Form is ReportsList
and the combo is rprts then:

DoCmd.OpenReport Forms!ReportList.rprts, acViewNormal, "", "", acNormal
I want to create a search form where the user can input a certain report name
and the report is pulled up. In the form, I have a combo box that has a list
[quoted text clipped - 4 lines]
example. Can I get some code for this type of search form or at least some
help. (I would love the code!!)
 
K

Kwgame

I am a newbie to access, How do I create a combo?

jahoobob via AccessMonster.com said:
Oh BTW, whenever a new report is added to the db that meets the criteria of
the query it shows up in the combo.
Simplify by giving the name of each report in one combo. MySysObjects is a
system table that is in each database, usually hidden. As the name indicates,
it lists all of the objects in the db including reports (Type -32764). You
can use a query to show just the report names that begin with PTP and TSP:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Like "PTP *" Or (MSysObjects.Name) Like "TSP *")
AND ((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;

You can then place Code or a Macro behind the AfterUpdate of the form on
which the combo resides that opens the report. If the Form is ReportsList
and the combo is rprts then:

DoCmd.OpenReport Forms!ReportList.rprts, acViewNormal, "", "", acNormal
I want to create a search form where the user can input a certain report name
and the report is pulled up. In the form, I have a combo box that has a list
[quoted text clipped - 4 lines]
example. Can I get some code for this type of search form or at least some
help. (I would love the code!!)
 
K

Kwgame

Are you talking about a combo box? I can do that

jahoobob via AccessMonster.com said:
Oh BTW, whenever a new report is added to the db that meets the criteria of
the query it shows up in the combo.
Simplify by giving the name of each report in one combo. MySysObjects is a
system table that is in each database, usually hidden. As the name indicates,
it lists all of the objects in the db including reports (Type -32764). You
can use a query to show just the report names that begin with PTP and TSP:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Like "PTP *" Or (MSysObjects.Name) Like "TSP *")
AND ((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;

You can then place Code or a Macro behind the AfterUpdate of the form on
which the combo resides that opens the report. If the Form is ReportsList
and the combo is rprts then:

DoCmd.OpenReport Forms!ReportList.rprts, acViewNormal, "", "", acNormal
I want to create a search form where the user can input a certain report name
and the report is pulled up. In the form, I have a combo box that has a list
[quoted text clipped - 4 lines]
example. Can I get some code for this type of search form or at least some
help. (I would love the code!!)
 
J

jahoobob via AccessMonster.com

Yes. I apologize for using "shorthand".
Are you talking about a combo box? I can do that
Oh BTW, whenever a new report is added to the db that meets the criteria of
the query it shows up in the combo.
[quoted text clipped - 21 lines]
 
Top