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

if on report

Status
Not open for further replies.

Zorro1265

Technical User
Nov 14, 2000
181
US
I have this in the on format event of my form. If the condition is true I want the report changed with the changes shown. If not I dont want anything changed. As it is the changes are always in effect the if doesn't seem to work. Any ideas?

If Me!StressProtocol = "Dobutamine" Then
Me!Minutes.Width = 4680
Me!BP.Left = 5640
Me!HR.Left = 6599.9
Me!Mets.Visible = False
Me!Grade.Visible = False
Me!MPH.Visible = False
 
Well, Basically I think you need an else clause to reset the values for the NOT true condition (you also need an "end If", but I'm assuming you just didn't copy that line.)

If (Me!StressProtocol = "Dobutamine" Then

Me!Minutes.Width = 4680
Me!BP.Left = 5640
Me!HR.Left = 6599.9
Me!Mets.Visible = False
Me!Grade.Visible = False
Me!MPH.Visible = False

Else

'For the values, I just plugged in some random dummies
Me!Minutes.Width = 3620 '4680
Me!BP.Left = 4650 '5640
Me!HR.Left = 5050.1 '6599.9
Me!Mets.Visible = True
Me!Grade.Visible = True
Me!MPH.Visible = True

End If


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Okay I will try that, I was hoping that when the "if" wasn't true it would just ignore it and skip the changes. Sorry I forgot to copy the endif you were right.B-)
 
Well, it does ignore the block of code when the condition is not true. Unfortunatly, it does ignore the block of code whrn the condition is Not True - but then after the first occurance of "True" for the condition, it ignores the bolck of code (or - for the short version - once changed, forever left that way).


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top