Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Question

Status
Not open for further replies.

nayfeh

Programmer
Mar 13, 2002
163
CA
Hi,

I have a label called "Duplicate". I would like my report to print this label only if necessary. It's based on a field called "Printed" in my underlying table. If the value in this field is greater than or equal to 1 then DUPLICATE should print, otherwise nothing.

I tried this code:

If Me.Printed >= 1 Then
lblDuplicate.Visible = True
Else: lblDuplicate.Visible = False
End If

I think I'm missing something. It could not get the value in the PRINTED field.

Thanks in advance.
TN
 
In the underlying query create another field called duplicate with the following line: 'duplicate:iif([printed]>=1,"DUPLICATE"," ")' (without the enclosing single quotes). If your report is not based on a query, then create one listing all the fields you need and repoint the report to this query and not the table. [pc]

Graham
 
Is there no way to make this label visible using the OnPrint event. It would get complicated creating another query since the report is generated through a SQL stored procedure and a form is used to generate it.

The Printed field is included in the stored procedure's query, so it is available in the field list for this report and I can attach it to the report as well.

I just need to know the code to have it the DUPLICATE label visible if the Printed value is > 0.

Thanks,
TN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top