A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

IIf A=1 then B=Visible



 
 
Thread Tools Display Modes
  #1  
Old October 10th, 2005, 08:16 PM
aaearhart
external usenet poster
 
Posts: n/a
Default 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  
Old October 10th, 2005, 08:23 PM
Rick B
external usenet poster
 
Posts: n/a
Default

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  
Old October 10th, 2005, 08:52 PM
Ofer
external usenet poster
 
Posts: n/a
Default

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  
Old October 10th, 2005, 08:53 PM
Ofer
external usenet poster
 
Posts: n/a
Default

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  
Old October 12th, 2005, 07:23 PM
aaearhart
external usenet poster
 
Posts: n/a
Default

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  
Old October 12th, 2005, 07:28 PM
aaearhart
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.