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

I need a "yes" or "no" 1

Status
Not open for further replies.

spoon1

Technical User
Apr 28, 2003
37
0
0
US
I have a text box "calcPOB1" that calculates the number of days to an event.
I have a text box "txtPOB1" that displays this data and is bound to a table.

I have yet another text box "finPOB1" that I want to display the final result of my quest: "closed" or "open" based on this criteria:
if the result of is less than or = 0 then "open"
if it's > = 1 then display "closed"
right now I have it in the 'on current' section but it doesnt work.. I tried it in the 'before' section but it's not working there either. Here is what I have as code..
this is the last part of my project.. this project is going to kill me!!
What am I doing wrong???? PLEASE HELP
Thank you

Me!txtPOB1 = Me!calcPOB1

Me!txtPOB2 = Me!calcPOB2

Me!txtPOB3 = Me!calcPOB3

#If calcPOB1 >= 1 Then
txtPOB1 = "closed"
#End If

#If calcPOB1 <= 0 Then
txtPOB1 = &quot;Open&quot;
#End If
 
Shouldn't txtPOB1 = &quot;closed&quot; read finPOB1 = &quot;closed&quot; ? Or did I miss something?

You're not alone,

TomCologne
 
try this

#If calcPOB1 >= 1 Then
txtPOB1.text = &quot;closed&quot;
Else
txtPOB1.text = &quot;Open&quot;
#End If
 
It's the weirdest thing... im using the code in &quot;before update&quot; (switching between before and current) it only gives me an OPEN answer no matter what the result is if it's a negative number &quot;OPEN&quot; (which is correct)
if it's a positive number &quot;CLOSED&quot; (which is wrong)
Im trying to be patient.. trying different things- but nothings working...
heres my code now:

Me!finPOB1.SetFocus
#If txtPOB1 >= 1 Then
finPOB1.Text = &quot;CLOSED&quot;
#Else
finPOB1.Text = &quot;OPEN&quot;
#End If
 
oops... i made a mistake in my last post...
if the result is a positive number it give me &quot;OPEN&quot; which is wrong.
sheesh!!! im losing my mind
 
How about this:

If calcPOB1 >= 1 Then

finPOB1.Text = &quot;OPEN&quot;

Else

finPOB1.Text = &quot;CLOSED&quot;

I don't really get your calcPOB1 vs txtPOB1 construction, but I know about the goin' nuts event.

TomCologne


 
I tried Tom, but no luck. The reason I have txtPOB1 = calcPOB1 is because I need to bind the result to a table.
calcPOB1 contains a formula for the control.
????
I have been reading and reading, and everything I read says my If then else should work, but it doesnt.. I wonder what Im doing wrong...
SOMEONE PLEASE HELP IF YOU CAN
 
GOT IT TOM!! YOU WERE RIGHT... i had just left out the set focus to your code...

Thanks a bunch, you've been a great help to help me work through this problem!!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top