Output filtered form into report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a little help. I have a Form based on a table that holds the
inventory of computers for the school I work for. When I run my filter, it
will give me all the records of all the computers of the same model. I want
to output those records into a Report. I would like it to be a single click
of a button. What I have now outputs every record in my table even though I
am only viewing my filtered results. Thanks!

--Giuliano
 
Hi Giuliano,

you can use the WHERE clause of the OpneReport action...

DoCmd.OpenReport reportname[, view][, filtername][,
wherecondition]

ie:

DoCmd.OpenReport "Reportname", acViewPreview,, "ModelID=" &
me.modelID

ModelID would, of course, have to be in the RecordSet of
your report

if the form and the report have the same fields, you can
also try this in the code behind your form (in case your
form is filtered by something more complex)

DoCmd.OpenReport "Reportname", acViewPreview,, me.filter

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)
 
Well, I tried the second suggestion mainly becasue I didn't understand the
first one. I am not too up on Access and am very new to it. The second
suggestion still output all the data to a report even though I had applied a
filter.

My database can be viewed at this URL:
http://us.f13.yahoofs.com/bc/443fe988_e4c2/bc/My+Documents/Computer+Inventory.zip?bfq4.PEBvbSYJb5G
It is in a zip archive. I understand if you don't want to open it. There
is no data in it yet other than random stuff for testing purposes. If you
are willing to help, I would be very appreciative and would love to see your
work to see how you did it. Like I said, I am so very new to this. I hope
this isn't an unusual request.

-Giuliano

strive4peace said:
Hi Giuliano,

you can use the WHERE clause of the OpneReport action...

DoCmd.OpenReport reportname[, view][, filtername][,
wherecondition]

ie:

DoCmd.OpenReport "Reportname", acViewPreview,, "ModelID=" &
me.modelID

ModelID would, of course, have to be in the RecordSet of
your report

if the form and the report have the same fields, you can
also try this in the code behind your form (in case your
form is filtered by something more complex)

DoCmd.OpenReport "Reportname", acViewPreview,, me.filter

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)

I need a little help. I have a Form based on a table that holds the
inventory of computers for the school I work for. When I run my filter, it
will give me all the records of all the computers of the same model. I want
to output those records into a Report. I would like it to be a single click
of a button. What I have now outputs every record in my table even though I
am only viewing my filtered results. Thanks!

--Giuliano
 
Auctually, never mind. I just went ahead and made a query for each computer
model we have and made a Report for each of those queries. I then put a
command button in the Form that will run a query and send the data to a
Report I made without having to apply a filter. Guess I should have done it
this way the first time. I would still love to see how to do it with the
filter, but if you dont' have the time, don't worry about it. Thanks a lot!

Giuliano A. Mazzina said:
Well, I tried the second suggestion mainly becasue I didn't understand the
first one. I am not too up on Access and am very new to it. The second
suggestion still output all the data to a report even though I had applied a
filter.

My database can be viewed at this URL:
http://us.f13.yahoofs.com/bc/443fe988_e4c2/bc/My+Documents/Computer+Inventory.zip?bfq4.PEBvbSYJb5G
It is in a zip archive. I understand if you don't want to open it. There
is no data in it yet other than random stuff for testing purposes. If you
are willing to help, I would be very appreciative and would love to see your
work to see how you did it. Like I said, I am so very new to this. I hope
this isn't an unusual request.

-Giuliano

strive4peace said:
Hi Giuliano,

you can use the WHERE clause of the OpneReport action...

DoCmd.OpenReport reportname[, view][, filtername][,
wherecondition]

ie:

DoCmd.OpenReport "Reportname", acViewPreview,, "ModelID=" &
me.modelID

ModelID would, of course, have to be in the RecordSet of
your report

if the form and the report have the same fields, you can
also try this in the code behind your form (in case your
form is filtered by something more complex)

DoCmd.OpenReport "Reportname", acViewPreview,, me.filter

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)

I need a little help. I have a Form based on a table that holds the
inventory of computers for the school I work for. When I run my filter, it
will give me all the records of all the computers of the same model. I want
to output those records into a Report. I would like it to be a single click
of a button. What I have now outputs every record in my table even though I
am only viewing my filtered results. Thanks!

--Giuliano
 
Hi Giuliano,

the URL is not valid, can you check it please?

I will be happy to look at the database. Please make sure
it is 2000 format -- Tools, Database Utilities, Convert ...

right now, that is the highest version I have loaded

thanks!

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)

Well, I tried the second suggestion mainly becasue I didn't understand the
first one. I am not too up on Access and am very new to it. The second
suggestion still output all the data to a report even though I had applied a
filter.

My database can be viewed at this URL:
http://us.f13.yahoofs.com/bc/443fe988_e4c2/bc/My+Documents/Computer+Inventory.zip?bfq4.PEBvbSYJb5G
It is in a zip archive. I understand if you don't want to open it. There
is no data in it yet other than random stuff for testing purposes. If you
are willing to help, I would be very appreciative and would love to see your
work to see how you did it. Like I said, I am so very new to this. I hope
this isn't an unusual request.

-Giuliano

:

Hi Giuliano,

you can use the WHERE clause of the OpneReport action...

DoCmd.OpenReport reportname[, view][, filtername][,
wherecondition]

ie:

DoCmd.OpenReport "Reportname", acViewPreview,, "ModelID=" &
me.modelID

ModelID would, of course, have to be in the RecordSet of
your report

if the form and the report have the same fields, you can
also try this in the code behind your form (in case your
form is filtered by something more complex)

DoCmd.OpenReport "Reportname", acViewPreview,, me.filter

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)

I need a little help. I have a Form based on a table that holds the
inventory of computers for the school I work for. When I run my filter, it
will give me all the records of all the computers of the same model. I want
to output those records into a Report. I would like it to be a single click
of a button. What I have now outputs every record in my table even though I
am only viewing my filtered results. Thanks!

--Giuliano
 
Back
Top