Show only one record in Print preview of Report (my database attached) (1 Viewer)

asgard

Registered User.
Local time
Yesterday, 21:13
Joined
Sep 2, 2011
Messages
11
My database (compatible with MS Access 2010 only) is linked here (8 Mb):

https://docs.google.com/leaf?id=0B3...ZTMzMi00YWVmLWI4NTMtZjFmMWE3YjM5ZTg2&hl=en_US

Here is the problem I have:

  1. Go to the "Reports" tab (in the "Main" form)
  2. On the "Test Checklist" section click "Preview"
  3. The "Test Checklist" report opens, but all the records show (the second record begins in the 3rd page)! I want only the current record to show.
Take a look at the "Test Checklist" report, you will see that it has a subform called "Test:ANSI expanded".

So what I want to do is to show only the "Test:ANSI expanded" subform for the current record.

So what do I have to do?
These are the things I've researched but I can't get them to work:

  1. "ID = " & Contacts.ID in the WHERE condition of a OpenReport button
  2. Linking master and child fields
Linking master and child fields doesn't work because I have more than 3 fields to link.

I appreciate any help :(
 
Last edited:

GinaWhipp

AWF VIP
Local time
Yesterday, 21:13
Joined
Jun 21, 2011
Messages
5,901
I did not look at your database. However, based on your post I belive you are missing...

If your field is numeric...
DoCmd.OpenReport "YourReport", acViewPreview, , "[FieldInReport]=" & Me![FieldOnForm]

If your field is text…
DoCmd.OpenReport "YourReport", acViewPreview, , "[FieldInReport]='" & Me![FieldOnForm] & "'"
 

asgard

Registered User.
Local time
Yesterday, 21:13
Joined
Sep 2, 2011
Messages
11
I did not look at your database. However, based on your post I belive you are missing...

If your field is numeric...
DoCmd.OpenReport "YourReport", acViewPreview, , "[FieldInReport]=" & Me![FieldOnForm]

If your field is text…
DoCmd.OpenReport "YourReport", acViewPreview, , "[FieldInReport]='" & Me![FieldOnForm] & "'"


Hmmm it didn't work.

What I basically have is a subform1 in a report1. In a form2 i have another subform2. In subform2, i have a button to print preview the report1. In print preview of the report1 the subform1 is displayed for every record :(.

The code you told me to put was on the OnClick of the button of subform2. I'm trying to link the primary key (called "ID") , so when you told me to put
"[FieldInReport]=" & Me![FieldOnForm]
I put
"[ID]=" & Me![ID]

I get no errors.

Also, all of these forms, subforms, and reports have the same record source table
 
Last edited:

GinaWhipp

AWF VIP
Local time
Yesterday, 21:13
Joined
Jun 21, 2011
Messages
5,901
I guess this means I have to look at your database...
 

GinaWhipp

AWF VIP
Local time
Yesterday, 21:13
Joined
Jun 21, 2011
Messages
5,901
Okay, perhaps someone else can do this but I know of no way to do this using a Navigation form. It can be done using standard subforms.
 

asgard

Registered User.
Local time
Yesterday, 21:13
Joined
Sep 2, 2011
Messages
11
Okay, perhaps someone else can do this but I know of no way to do this using a Navigation form. It can be done using standard subforms.


I really appreciate your help! It might seem like nothing, but I now know it's because of the nav form (I thought I was going crazy:confused:). If I figure it out, I'll come back here to say what I did!:)
 

Users who are viewing this thread

Top Bottom