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

TO CHANGE VISIBLE PROPERTY OF A FIELD 2

Status
Not open for further replies.

desikan

Technical User
Feb 2, 2001
105
AE
Hi,
I am using Access 2000. I am prepaing a
report having following fields : [item Name],[warranty],[FOB COST],expr1=[FOB COST]*0.3.
The last item is the repair cost of the item.

Now I want the report to contain the last field i.e the repair cost only when [warranty]="out of warranty". When [warranty]="under warranty", the repair cost field should be invisible.

Can anyone please help me to get this done?

R.Desikan
 
Try changing the visible property to NO in your design view.
 
Hi,
Thanks for your reply but it does not solve the problem.

I want the visible property to be set "no" automatically if [warranty] field is "under warranty". If [warranty] field is "out of warranty", then the visible property is to be set "yes".

R.Desikan
 
in the Detail section of your report (in design view) you can put in the On Format event:

if me.warranty = "out of warranty" then
me.RepairCost.visible = false
else
me.RepairCost.visible = true
end if

if you do not know what i mean:
go to the design of the report
if you do not see the PROPERTIES panel already, choose VIEW+PROPERTIES from the menu bar.
click once on the grey bar that says DETAIL on it on the report design.
in the ON FORMAT event in the properties, choose [Event Procedure] and click on the little button to the right with the three dots on it. paste in the code above.

g
 
Thanks a lot.
Your code worked beautifully.

Thanks once again.

R.Desikan

 
Did you consider using a Conditional Formatting? Set the font color to White if a certain criteria is met?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top