Hiding a label on a report

shaz123

Registered User.
Local time
Today, 07:00
Joined
Sep 8, 2006
Messages
81
If a cylinder has been returned i do not want the desciption label to show for that particular cylinder record, with the code below i was trying to do just that but even if a cylinder has been returned or not then the description label doesnt show, can anyone see what is wrong with this coding.


Code:

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim StrSQl As String

Set db = CurrentDb

Set rs = db.OpenRecordset("SELECT * From tbl_TransactionMaster Where [Cylinder Number] = '" & Me![Cylinder Number] & "'")

If rs![R Status] = "Returned" Then
lblDescription.Visible = True

Else

lblDescription.Visible = False
End If

End Sub
 
Conditional formatting can be achieved via vba code when you design
your report. You need to go to the section of your report where the
label is showing and write a sub to make it visible or invisible.
 

Users who are viewing this thread

Back
Top Bottom