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

Continuous Forms

Status
Not open for further replies.

Chicagodude

Programmer
Nov 18, 2008
11
US
I have a Continuous Forms as sub form. It has three text box.
Text55, Text75 and lblmessage

Here what i want a do. If text75 > text55 then lblmessage is visible= true else false.

I have this code on after update event on text75.
If Me.Text75 > Me.Text55 Then
Me.lblmessage.Visible = True
Else
Me.lblmessage.Visible = False
End If

I have three records on my Continuous Forms. I enter data for first row and text75< text55 then lblmessage.visible = false. As soon as i enter value for row2 which is text75>text55 then lblmessage visible but it visible for all three record insted of only row2 becuase row 1 does not meet the critaria.

As soon as i enter value for row 3 with is like row1 the lblmessage get disappear. How can i code so it is based on that row not all rows.
 

You cannot do this with continuous forms because, what you actually see is multiple copies of the same label. You might be able to accomplish what you want using conditional formatting.


Randy
 
How are ya Chicagodude . . .

This can be done with [blue]conditional formatting[/blue], however you need to be aware of two items:
[ol][li][blue]Conditional formatting[/blue] doesn't work with labels!. Are you sure [blue]lblmessage[/blue] is a textbox?[/li]
[li][blue]Conditional formatting[/blue] can handle the [blue]Enabled[/blue] property, [red]not the Visible[/red] property. [blue]The disabled look[/blue] may not appeal to you. [surprise][/li][/ol]

Make your determinations and advise.

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
You have done the right thing in making [lblmessage] a text box. Instead of manipulating [lblmessage].visible, you can set the control source of [lblmessage] on the property sheet. You don't need any VBA. Here's a sample of what the control source should look like:

=IIf([text75]>[text55],"Message","")

Thus if [text75]>[text55], you will see "Message" in the [lblmessage] control. Otherwise the control will be blank.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top