More Code Help

Cpar

Registered User.
Local time
Today, 06:41
Joined
Jan 9, 2016
Messages
41
Ok so i got some help to write a line of code, but now i need a bit more help. Once again i am very new to coding so if you decide to help try to make it easy! :):) I have a custom form with a box called pressure range. When Pressure Range is above 30,000 i want another box to say something. When pressure range is below 30,000 i want it to say two things. For example if pressure range is below 30,000 i want it to say "1" (right below that i want it to say) "2"
Is this possible through code?
 
you already posted this one.
on your "other box" control source, put this

=iif([pressure range] < 3000, "1", "2")
 
Not quite. So i have a box that says 29000 Pressure Range. I need another box to auto fill with txt like so.

"Today"
"Tomorrow"


I have my code something like this:

Private Sub Pressure_Range_AfterUpdate()
If Me.Pressure_Range < 30000 Then
Me.Text682 = "Today"
Me.Text682 = "Tomorrow"
Else
Me.Text682 = "Next Week"
End If

End Sub


This however does not do what i want. Any ideas?
 
What triggers today and what triggers tomorrow ? I am assuming next week is >30000. The programme needs to know this information , then you can apply the code to answer all three responses when the conditon is true .

Regards Ypma
 
Something like this is not going to help people help you. You need to show the exact code.

In your code below you set Me.text682 to Today and immediately overwrite it with Tomorrow ?

Not quite. So i have a box that says 29000 Pressure Range. I need another box to auto fill with txt like so.

"Today"
"Tomorrow"


I have my code something like this:

Private Sub Pressure_Range_AfterUpdate()
If Me.Pressure_Range < 30000 Then
Me.Text682 = "Today"
Me.Text682 = "Tomorrow"
Else
Me.Text682 = "Next Week"
End If

End Sub


This however does not do what i want. Any ideas?
 
you dont need code for that just set the Control source of text682:

=IIF([pressure range] < 3000, "Today", IIF([pressure range] = 3000, "Tommorow", IIF([pressure range] > 3000, "Next Week", "")))
 
Ok guys thanks for the help so far. I think what i want to go with is a list box if possible. Is it possible to use if statement to make certain things to appear in a list box?
 
if it is bound textbox, that will not work.

in the sample db there are two forms, one with bound textbox ([text]) and the other unbound textbox ([text]).

this will give you a clearer view.
 

Attachments

Users who are viewing this thread

Back
Top Bottom