title: ms access dynamically change label on report
body: <p>I am printing a production ticket as a report using the following code:</p>
  
  <pre><code>Dim strCriteria As String
   strCriteria = "SELECT [PkgSize] &amp; chr$(32) &amp; [PkgUnit] AS Pkg, tblProducts.ProductID, tblProducts.ProductPrintName, tblProducts.Grade, " _
              &amp; " tblCustomers.CompanyName, tblOrderDetails.ODEPriority, chr$(33) &amp; chr$(70) &amp; [tblProducts].[ProductID] &amp; [tblCustomers].[ID] &amp; chr$(33)as Expr1" _
              &amp; " FROM tblCustomers INNER JOIN (tblOrders INNER JOIN (tblProducts INNER JOIN tblOrderDetails ON " _
              &amp; " tblProducts.ProductID = tblOrderDetails.ODEProductFK) ON tblOrders.ORDOrderID = tblOrderDetails.ODEOrderID) ON " _
              &amp; " tblCustomers.ID = tblOrders.ORDCustomerID " _
              &amp; " WHERE (((tblProducts.ProductID)=[Forms]![frmInventoryTransfersManual]![cboTransferProductID]) " _
              &amp; " AND ((tblOrderDetails.ODEPriority)= " &amp; varPriority &amp; ") AND (([tblOrderDetails]![ODEQtyOrdered]-[tblOrderDetails]![ODEQtyProduced])&gt;0))"
  
   DoCmd.OpenReport "rptProductPaperLabelTCTRlogo", acViewPreview, , , , strCriteria    
  </code></pre>
  
  <p>In the report I have:</p>
  
  <pre><code>Private Sub Report_Open(Cancel As Integer)
      Me.RecordSource = Me.OpenArgs
  End Sub
  </code></pre>
  
  <p>The various text boxes on the report use the following as their Control Sources: Grade, Expr1, ProductPrintName, Pkg, and CompanyName. (Expr1 produces a barcode for scanning the ticket.)</p>
  
  <p>It works perfectly.  However, I also need to print a label or, could be, a text box to form a border on the report.  This label/textbox will be a color assigned to CompanyName. Therefore, the ticket can be seen quickly and know who the customer is just by knowing the color of this label/textbox. </p>
  
  <p>Can anyone help me to change the color of a label/text box on the report dependent on the company name.  We have about 20 different customers. </p>