By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,506 Members | 2,275 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,506 IT Pros & Developers. It's quick & easy.

Help with setting a label to Visible

P: 19
I have an access data base we use to create reminder letters for our dr's patients. The patients appts are imported into access, a query ran on the data and report is used to make the actual letter. I want to add a custom txt box or label for one of the dr's but want to do it based on the dr's name. Here is the code i have:

If (Me.RESC_NAME = "Dr name taken out for security purpose") Then
Me.txtTurner.Properties.Visible = True
Else
Me.txtTurner.Properties.Visible = False
End If

if I just do me. to see what options i get, the txtTurner is not in the list but other text boxes and labels are. Any ideas?
Nov 10 '08 #1
Share this Question
Share on Google+
4 Replies


P: 19
I have also tried this on a click event:

If (Me.RESC_NAME = "Dr name") Then
Report_CNT.txtTurner.Properties.Application.Visibl e = True
Else
Report_CNT.txtTurner.Properties.Application.Visibl e = False
End If

and that didn't work either.
Nov 10 '08 #2

Expert 100+
P: 1,287
It looks like you want to use iif in the field definition
IIf(expr, truepart, falsepart)
so iif("DrName = ""Whatever""", replacement, DrName)
and the replacement can just be "" if you want.
Chip
Nov 10 '08 #3

missinglinq
Expert 2.5K+
P: 3,532
Your basic syntax is incorrect.

Me.txtTurner.Properties.Visible = True

should simply be

Me.txtTurner.Visible = True

Welcome to Bytes!

Linq ;0)>
Nov 10 '08 #4

P: 19
ChipR: That did the trick. I very much appreciate your help. I spent all most all day yesterday trying to get this to work.
Nov 11 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.