Access 2002 Conditional Caption

Access 2002 Conditional Caption

am 16.01.2008 18:52:25 von dkohel

I have a form that returns 100 items. All of the items have have a
different value in their Category field.

EXAMPLE:
----------------
A
B
C

How can I change the value of the caption in the field label on the
form based on the category? I attempted a series of Case statements
but it didn't seem to work when values of mixed categories were
returned.

Select Case PriceCat
Case "A"
MsgBox ([tblProduct.PriceTyp])
Me![frmSubSearch].Form.prdPrice1Gl.ControlSource =
"PriceTypeA"
Me![frmSubSearch].Form.prdPrice5Gl.ControlSource =
"PriceTypeB"
Me![frmSubSearch].Form.prdPrice5GlCF.ControlSource =
"PriceTypeC"
Me![frmSubSearch].Form.lblItemSubPrice1.Caption = "A"
Me![frmSubSearch].Form.lblItemSubPrice5.Caption = "B"
Me![frmSubSearch].Form.lblItemSubPrice5CF.Caption = "C"
Case Else
Me![frmSubSearch].Form.prdPrice1Gl.ControlSource = "1"
Me![frmSubSearch].Form.prdPrice5Gl.ControlSource = "2"
Me![frmSubSearch].Form.prdPrice5GlCF.ControlSource = "3"
Me![frmSubSearch].Form.lblItemSubPrice1.Caption = "1"
Me![frmSubSearch].Form.lblItemSubPrice5.Caption = "2"
Me![frmSubSearch].Form.lblItemSubPrice5CF.Caption = "3"
End Select