Results not showing in TextBox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tmdrake
    New Member
    • Mar 2013
    • 43

    Results not showing in TextBox

    Based on the selection in a combo box using a dropdown list (Row Source Table) and the information entered into 2 text boxes, the results should show up in a text box, it's not happening. Don't know what is wrong. Below is the code use to calculate the results that shoud appear.

    Code:
    Private Sub Text25_Click()
    Select Case Me.Action
        Case "NegativePullTest"
            If Me.PullForce >= 15 And Me.Nuggets >= 5 Then Me.Text25 = "Passed"
            If Me.PullForce <= 14 And Me.Nuggets <= 4 Then Me.Text25 = "Failed"
            If Me.PullForce >= 15 And Me.Nuggets <= 4 Then Me.Text25 = "Failed"
            If Me.PullForce <= 14 And Me.Nuggets >= 5 Then Me.Text25 = "Failed"
      
        Case "PositivePullTest"
            If Me.PullForce >= 8 And Me.Nuggets >= 5 Then Me.Text25 = "failed"
            If Me.PullForce <= 7 And Me.Nuggets <= 4 Then Me.Text25 = "Passed"
    End Select
    If Me.Text25 = "Failed" Then
         MsgBox "Test Failed, Input cell with pass pop and then retest"
    End If
    End Sub
    Please help because this was working now it's not.

    Thanks
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    By, simply stating that your code "doesn't work," no mention if there are any errors along with code that appears to have had very little if any troubleshooting performed, and expecting someone to help doesn't usually result in much of an answer

    Please tell us what you were expecting to happen, what actually happened, for each error: the EXACT title, error number, and descriptions that occurred and at what line in your posted code the error occurred. These are the minimum requirements for posting a question of this nature.

    You should also work your way thru the trouble shooting section of: > Before Posting (VBA or SQL) Code

    You should also insert a "Stop" right before the "Select" block and use [f8] to step thru your code a few times to see what is happening.
    Last edited by zmbd; Mar 20 '13, 12:06 PM.

    Comment

    • tmdrake
      New Member
      • Mar 2013
      • 43

      #3
      That was my point, I not getting any errors, the cursor just blinks in the field. I have tried to trouble shoot it myself before posting. If continuing to request help is a problem, please let me know.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        There are a few possibilities.

        1) Your numbers fall in a range not covered by the positive pull test.

        2) Your Action control doesn't contain the value you think it contains.

        3) You didn't click in Text25 to trigger the code.

        4) Code is disabled.

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #5
          tmdrake:
          Please understand, it is not the asking for help that is the problem... it is the fact that I (read all the experts/mods) are not sitting in front of your PC with your database; thus, you must actually perform the basic troubleshooting steps

          AND

          you must provide enough detail for us to work with.

          - The fact that you didn't receive any error messages is valuable information. It tells me that more than likely your VBA isn't calling on a mis-named control. You would not believe the number of times members have failed to mention that they were getting errors and just say, "(...)it doesn't work... please fix it for me."

          - The fact that at one point this was working and isn't now is also valuable. This tells me that you've changed something. What was the last thing you did before this stopped?

          - Did you do as I asked:
          You should also insert a "Stop" right before the "Select" block and use [f8] to step thru your code a few times to see what is happening.
          in my last post. If not then please do so.... I cannot do this for you on your PC. Please be fairly detailed in what happens. My guess is that when you step thru the code the value in Me.Action does not meet any of your select case values. String comparisons are case sensitive ( Capital letter "A" is not the same as lower case letter "a"). Or that the value you are testing for within the case conditional is not matching any of the IF-Then statements.

          - Also, in another one of your threads, I directed you to some of the insight articles about VBA troubleshooting ... you should review those as these are the basis of how we will be helping you along... fairly well done - although for an earlier version, the information still pertains to V2007 and V2010.

          Bytes is neither a code writing nor homework service. Please read the > FAQ and posting guidelines.
          Last edited by zmbd; Mar 20 '13, 05:21 PM. Reason: [Z{Rabbit, slow down and let me type... that Z isn't from buzzing bees ;)}]

          Comment

          Working...