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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Label contents programatically

Status
Not open for further replies.

Principal

IS-IT--Management
Oct 12, 2002
37
0
0
US
As usual, I seem to have most of my Access difficulties with simple requests. I am using Access 2002. I have a form that utilizes a checkbox indicating an individual's status. For those users who have the status box checked I want to add text to the end of the first line of my label. The text is the same for all who have the box checked. My simple code is located in the formatevent section of the report. My problem is that any attempt to re-assign the value of label text box fails. How do I code the following:

If the checkbox = true
print lastname plus the specified additional text
else
print lastname

Any insigt is much appreciated.

Steve

 
Steve
I have something similiar, I think, on an Accounts Statement form. If the customer has a Credit Balance, a message prints, if not no message.

I put a text box next to the Balance in the Detail section of the report. The text box is as follows...
=IIf([txtBalance]<-1,"Please note...you have a Credit balance!","")

Nothing goes in the OnFormat event, just the text box in the Detail section.

Will this approach work for your situation? If so, your text box would be something like this...

IIf([checkbox]=True,[LastName]& " " & "specified additional text", [LastName]

Tom
 
Tom:

That worked perfectly. It was a very simple, elegant solution. I have doe some fairly complex things with Access (I have a SQL backaground) and I stumble with these items. I am so used to working with variables and moving them around. Again, thank you.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top