Label generated from Form - Single record

Mike1sMike

New member
Local time
Today, 08:00
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.
 
Hi. You should be able to use the WhereCondition argument of the OpenReport method.
 
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

Back
Top Bottom