If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
IIf A=1 then B=Visible
this is what i have:
myText (unbound) Control Source: =Sum(DateDiff("d",[StartDate],[EndDate])) myCheckBox (unbound) Control Source: Show days? when the report loads, you are asked "show days?", when you enter 1, the box is checked, 0=unchecked. now i need this. if myCheckBox=1 myText=visible else, not visible i'm foggy on what the code should be and even foggier on when/where it should be. i can put it in myForm's OnOpen event or maybe the OnActivate event. thanks again, all! /amelia |
#2
|
|||
|
|||
Not tested, but I think the following is correct...
In an unbound text box, put... = IIF([myCheckBox]=1, myText,"") -- Rick B "aaearhart" wrote in message ... this is what i have: myText (unbound) Control Source: =Sum(DateDiff("d",[StartDate],[EndDate])) myCheckBox (unbound) Control Source: Show days? when the report loads, you are asked "show days?", when you enter 1, the box is checked, 0=unchecked. now i need this. if myCheckBox=1 myText=visible else, not visible i'm foggy on what the code should be and even foggier on when/where it should be. i can put it in myForm's OnOpen event or maybe the OnActivate event. thanks again, all! /amelia |
#3
|
|||
|
|||
On the OnOpen event of the report you can write the code
Dim Respone as string Respone = inputBox("Show days?") Me.myText.Visible = (Respone = "1") Me.myCheckBox = Val(Respone) -- I hope that helped Good luck "aaearhart" wrote: this is what i have: myText (unbound) Control Source: =Sum(DateDiff("d",[StartDate],[EndDate])) myCheckBox (unbound) Control Source: Show days? when the report loads, you are asked "show days?", when you enter 1, the box is checked, 0=unchecked. now i need this. if myCheckBox=1 myText=visible else, not visible i'm foggy on what the code should be and even foggier on when/where it should be. i can put it in myForm's OnOpen event or maybe the OnActivate event. thanks again, all! /amelia |
#4
|
|||
|
|||
One more thing, if you try this code, then remove the Show days? From the
Control Source -- I hope that helped Good luck "aaearhart" wrote: this is what i have: myText (unbound) Control Source: =Sum(DateDiff("d",[StartDate],[EndDate])) myCheckBox (unbound) Control Source: Show days? when the report loads, you are asked "show days?", when you enter 1, the box is checked, 0=unchecked. now i need this. if myCheckBox=1 myText=visible else, not visible i'm foggy on what the code should be and even foggier on when/where it should be. i can put it in myForm's OnOpen event or maybe the OnActivate event. thanks again, all! /amelia |
#5
|
|||
|
|||
Ofer-
in the code Me.myText.Visible = (Respone = "1") and Me.myCheckBox = Val(Respone) is "Respone" supposed to be "Response"? thanks! "Ofer" wrote: On the OnOpen event of the report you can write the code Dim Respone as string Respone = inputBox("Show days?") Me.myText.Visible = (Respone = "1") Me.myCheckBox = Val(Respone) -- I hope that helped Good luck "aaearhart" wrote: this is what i have: myText (unbound) Control Source: =Sum(DateDiff("d",[StartDate],[EndDate])) myCheckBox (unbound) Control Source: Show days? when the report loads, you are asked "show days?", when you enter 1, the box is checked, 0=unchecked. now i need this. if myCheckBox=1 myText=visible else, not visible i'm foggy on what the code should be and even foggier on when/where it should be. i can put it in myForm's OnOpen event or maybe the OnActivate event. thanks again, all! /amelia |
#6
|
|||
|
|||
thanks! i sorted it. here's what i ended up with:
Private Sub Report_Open(Cancel As Integer) Dim Respone As String Respone = InputBox("Show total travel days?") TotalDays.Visible = (Respone = "yes") ShowDays = Val(Respone) End Sub "Ofer" wrote: On the OnOpen event of the report you can write the code Dim Respone as string Respone = inputBox("Show days?") Me.myText.Visible = (Respone = "1") Me.myCheckBox = Val(Respone) -- I hope that helped Good luck "aaearhart" wrote: this is what i have: myText (unbound) Control Source: =Sum(DateDiff("d",[StartDate],[EndDate])) myCheckBox (unbound) Control Source: Show days? when the report loads, you are asked "show days?", when you enter 1, the box is checked, 0=unchecked. now i need this. if myCheckBox=1 myText=visible else, not visible i'm foggy on what the code should be and even foggier on when/where it should be. i can put it in myForm's OnOpen event or maybe the OnActivate event. thanks again, all! /amelia |
Thread Tools | |
Display Modes | |
|
|