Click here to Skip to main content
16,021,288 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to Lightswitch 2011.

All I want to do is run a query that will show text message if results are returned and another text message if false.. I can do this , but when the query does not change, the message does not appear.

I know it is because I used the Procedure SelectionChanged below. What else could I possibly used.

VB
Private Sub Query1_SelectionChanged()
            Dim TotalCount As Integer

            TotalCount = Me.Query1.Count

            If TotalCount = 1 Then
                Me.ShowMessageBox("This is a Bostik Part. Please check batch card again")


            End If

            If TotalCount = 0 Then
                Me.ShowMessageBox("Please Press Enter to continue")
            End If


        End Sub


Look forward to hearing from you
Posted
Updated 1-Aug-12 12:36pm
v2
Comments
Kenneth Haugland 2-Aug-12 11:41am    
I dont completely understand what you are getting at here. so the query count dosent change, but the items might. Is that waht you want the trigger to see?

1 solution

You should get the TextChange event and check for e.Key = Enter.
 
Share this answer
 
Comments
Member 9328877 2-Aug-12 21:24pm    
Hi Kenneth,

Thanks for the info.
I also need to display a message if the text does not change. Fo r exmplae if the text is 3 then a message box appears "Warning"
After closing Message box and user enters 3 again, the message box does not appear.

Do you know how to resolve this?

Look forward to hearing from you.

Thanks
Kenneth Haugland 2-Aug-12 23:32pm    
Well, you need to check an oldlist against a new list to see if they are equal.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900