Label generated from Form - Single record (1 Viewer)

Mike1sMike

New member
Local time
Today, 03:32
Joined
Apr 24, 2020
Messages
16
This has to be simple. I have a form generated from a query with a linked subform and some calculated fields. I want to print a label from THAT record but when I create the label, it wants to print everybody and their cousin's labels also. How do I select that record only and where is the coding so when I push the cmdButton for a label on that form, only that record will print.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:32
Joined
Oct 29, 2018
Messages
21,474
Hi. You should be able to use the WhereCondition argument of the OpenReport method.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:32
Joined
May 7, 2009
Messages
19,245
create a New Query and only include "the table" (don't include the other related table).
add the field where it can be also found in your Form.
create a Criteria to filter your query to only show values that is same as on the Form:

Field: theFieldnameHere
Table: theTablenameHere
Sort:
Show: (tick)
Criteria: [Forms]![yourForm]![theTextboxOnthisForm]

use this Query as Record Source of your Label Report.
 

Users who are viewing this thread

Top Bottom