A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access Reports



 
 
Thread Tools Display Modes
  #1  
Old June 20th, 2007, 09:51 PM posted to microsoft.public.access.reports
gg[_2_]
external usenet poster
 
Posts: 2
Default Access Reports

Have a small employee database. Want to print ID cards for new hires.
report works fine for the whole file, but for one-at-a-time, it seems that
the report doesn't respect to filter - It wants to print all records
instead of the filtered table. Appreciate any help.

gg


  #2  
Old June 20th, 2007, 11:04 PM posted to microsoft.public.access.reports
Carl Rapson
external usenet poster
 
Posts: 517
Default Access Reports

"gg" wrote in message
t...
Have a small employee database. Want to print ID cards for new hires.
report works fine for the whole file, but for one-at-a-time, it seems that
the report doesn't respect to filter - It wants to print all records
instead of the filtered table. Appreciate any help.

gg



What mechanism are you using to print your report?

Carl Rapson


  #3  
Old June 21st, 2007, 12:51 AM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Access Reports

On Wed, 20 Jun 2007 13:51:33 -0700, gg wrote:

Have a small employee database. Want to print ID cards for new hires.
report works fine for the whole file, but for one-at-a-time, it seems that
the report doesn't respect to filter - It wants to print all records
instead of the filtered table. Appreciate any help.

gg


Your table should have a unique prime key field.
In my example it is named [RecordID].

Display your employee records on a form.
Add a command button.

On the command button's property sheet write
[Event Procedure]
on the Click event line.
Then click on the little button with 3 dots that will appear on that
line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines write:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
[RecordID]

The above assumes a [RecordID] field that is a Number Datatype.

If, however, [RecordID] is Text Datatype, then use:

DoCmd.OpenReport "ReportName", acViewPreview, ,"[RecordID] = '" &
[RecordID] & "'"

as the Where clause.

For clarity, the single and double quotes are..
"[RecordID] = ' " & [RecordID] & " ' "

Change [RecordID] to whatever the actual field name is that you are
using.

See VBA Help files for:
Where Clause + Restrict data to a subset of records'
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #4  
Old June 21st, 2007, 05:42 PM posted to microsoft.public.access.reports
rod_skeeter
external usenet poster
 
Posts: 1
Default Access Reports

On Jun 20, 6:51 pm, fredg wrote:
On Wed, 20 Jun 2007 13:51:33 -0700, gg wrote:
Have a small employee database. Want to print ID cards for new hires.
report works fine for the whole file, but for one-at-a-time, it seems that
the report doesn't respect to filter - It wants to print all records
instead of the filtered table. Appreciate any help.


gg


Your table should have a unique prime key field.
In my example it is named [RecordID].

Display your employee records on a form.
Add a command button.

On the command button's property sheet write
[Event Procedure]
on the Click event line.
Then click on the little button with 3 dots that will appear on that
line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines write:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
[RecordID]

The above assumes a [RecordID] field that is a Number Datatype.

If, however, [RecordID] is Text Datatype, then use:

DoCmd.OpenReport "ReportName", acViewPreview, ,"[RecordID] = '" &
[RecordID] & "'"

as the Where clause.

For clarity, the single and double quotes are..
"[RecordID] = ' " & [RecordID] & " ' "

Change [RecordID] to whatever the actual field name is that you are
using.

See VBA Help files for:
Where Clause + Restrict data to a subset of records'
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


I had a similiar issue with employee applications. Instead of all the
complex programming, I just duplicated the report and the query it was
based on.

Then I redefined my report (RPT#2 for reference) to be based on the
QRY#2. Then in QRY#2, for my field EmpID I put in the following in
the criteria box ( =[] ). No parentheses. Then when I am ready to
generate one application instead of ALL, I click the RPT#2 which then
asks for the parameter value (in this case the EmpID number (e.g.
225).

This way we only get the report/application or in your case ID Card
that you want for a specific employee.

Kindest Regards,

rod_skeeter

  #5  
Old June 23rd, 2007, 10:06 PM posted to microsoft.public.access.reports
gg[_2_]
external usenet poster
 
Posts: 2
Default Access Reports

Thanks, Fred - Works great.


"fredg" wrote in message
. ..
On Wed, 20 Jun 2007 13:51:33 -0700, gg wrote:

Have a small employee database. Want to print ID cards for new hires.
report works fine for the whole file, but for one-at-a-time, it seems
that
the report doesn't respect to filter - It wants to print all records
instead of the filtered table. Appreciate any help.

gg


Your table should have a unique prime key field.
In my example it is named [RecordID].

Display your employee records on a form.
Add a command button.

On the command button's property sheet write
[Event Procedure]
on the Click event line.
Then click on the little button with 3 dots that will appear on that
line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines write:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
[RecordID]

The above assumes a [RecordID] field that is a Number Datatype.

If, however, [RecordID] is Text Datatype, then use:

DoCmd.OpenReport "ReportName", acViewPreview, ,"[RecordID] = '" &
[RecordID] & "'"

as the Where clause.

For clarity, the single and double quotes are..
"[RecordID] = ' " & [RecordID] & " ' "

Change [RecordID] to whatever the actual field name is that you are
using.

See VBA Help files for:
Where Clause + Restrict data to a subset of records'
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail



  #6  
Old August 3rd, 2007, 11:32 AM posted to microsoft.public.access.reports
Emelina Bumsquash
external usenet poster
 
Posts: 45
Default Access Reports

Hi Fred,
I found this useful piece of information which is relevant to what i want to
do as well. I've tried the code but with mine, it just opens the report as
usual - i was expecting some kind of dialogue box to ask you what [RecordID]
(or [StudyNumber], in my case) you want to filter by.

it may be the design of my report - it's all very complex by basically
there's a report with a number of subreports attached to queries. each of
these subreports returns the data for all the study numbers but i wanted a
filter as you open the report which means all the subreports (queries) filter
by the given study number and just show results for one person.

is this possible? thanks in advance for any help, Emma

"fredg" wrote:

On Wed, 20 Jun 2007 13:51:33 -0700, gg wrote:

Have a small employee database. Want to print ID cards for new hires.
report works fine for the whole file, but for one-at-a-time, it seems that
the report doesn't respect to filter - It wants to print all records
instead of the filtered table. Appreciate any help.

gg


Your table should have a unique prime key field.
In my example it is named [RecordID].

Display your employee records on a form.
Add a command button.

On the command button's property sheet write
[Event Procedure]
on the Click event line.
Then click on the little button with 3 dots that will appear on that
line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines write:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
[RecordID]

The above assumes a [RecordID] field that is a Number Datatype.

If, however, [RecordID] is Text Datatype, then use:

DoCmd.OpenReport "ReportName", acViewPreview, ,"[RecordID] = '" &
[RecordID] & "'"

as the Where clause.

For clarity, the single and double quotes are..
"[RecordID] = ' " & [RecordID] & " ' "

Change [RecordID] to whatever the actual field name is that you are
using.

See VBA Help files for:
Where Clause + Restrict data to a subset of records'
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.